コード例 #1
0
ファイル: AirspaceRenderer.cpp プロジェクト: DRIZO/xcsoar
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);
  }
}
コード例 #2
0
ファイル: MarkerRenderer.cpp プロジェクト: CnZoom/XcSoarPull
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);
  }
}
コード例 #3
0
ファイル: Marks.cpp プロジェクト: galippi/xcsoar
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);
  }
}
コード例 #4
0
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);
    }
  }
}
コード例 #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);
  }
}
コード例 #6
0
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
}