Example #1
0
void
AirspaceRenderer::DrawIntersections(Canvas &canvas,
                                    const WindowProjection &projection) const
{
  for (unsigned i = intersections.size(); i--;) {
    RasterPoint sc;
    if (projection.GeoToScreenIfVisible(intersections[i], sc))
      look.intercept_icon.Draw(canvas, sc.x, sc.y);
  }
}
Example #2
0
static void
RenderMarkers(Canvas &canvas, const WindowProjection &projection,
              const MarkerLook &look, const Markers &markers)
{
  for (const Marker &m : markers) {
    RasterPoint pt;
    if (projection.GeoToScreenIfVisible(m.location, pt))
      look.icon.Draw(canvas, pt);
  }
}
Example #3
0
void Marks::Draw(Canvas &canvas, const WindowProjection &projection)
{
  Poco::ScopedRWLock protect(lock, false); // read only

  for (unsigned i = 0; i < marker_store.size(); i++) {
    RasterPoint sc;
    if (projection.GeoToScreenIfVisible(marker_store[i], sc))
      icon.draw(canvas, sc);
  }
}
void
TopographyFileRenderer::PaintPoint(Canvas &canvas,
                                   const WindowProjection &projection,
                                   const unsigned short *lines,
                                   const unsigned short *end_lines,
                                   const GeoPoint *points) const
{
  if (!icon.IsDefined())
    return;

  for (; lines < end_lines; ++lines) {
    const GeoPoint *end = points + *lines;
    for (; points < end; ++points) {
      RasterPoint sc;
      if (projection.GeoToScreenIfVisible(*points, sc))
        icon.Draw(canvas, sc.x, sc.y);
    }
  }
}
Example #5
0
static void
DrawThermalSources(Canvas &canvas, const MaskedIcon &icon,
                   const WindowProjection &projection,
                   const T &sources,
                   const double aircraft_altitude,
                   const SpeedVector &wind)
{
  for (const auto &source : sources) {
    // find height difference
    if (aircraft_altitude < source.ground_height)
      continue;

    // draw thermal at location it would be at the glider's height
    GeoPoint location = wind.IsNonZero()
      ? source.CalculateAdjustedLocation(aircraft_altitude, wind)
      : source.location;

    // draw if it is in the field of view
    PixelPoint pt;
    if (projection.GeoToScreenIfVisible(location, pt))
      icon.Draw(canvas, pt);
  }
}
void
TopographyFileRenderer::PaintPoint(Canvas &canvas,
                                   const WindowProjection &projection,
                                   const XShape &shape,
                                   float *opengl_matrix) const
{
  if (!icon.IsDefined())
    return;

  // TODO: for now i assume there is only one point for point-XShapes

  RasterPoint sc;
  if (!projection.GeoToScreenIfVisible(shape.get_center(), sc))
    return;

#ifndef HAVE_GLES
  glPushMatrix();
  glLoadMatrixf(opengl_matrix);
#endif
  icon.Draw(canvas, sc.x, sc.y);
#ifndef HAVE_GLES
  glPopMatrix();
#endif
}