Beispiel #1
0
  void Visit(const AirspaceCircle& airspace) {
    RasterPoint screen_center = projection.GeoToScreen(airspace.GetCenter());
    unsigned screen_radius = projection.GeoToScreenDistance(airspace.GetRadius());
    GLEnable stencil(GL_STENCIL_TEST);

    {
      GLEnable blend(GL_BLEND);
      setup_interior(airspace);
      if (m_warnings.is_warning(airspace) ||
          m_warnings.is_inside(airspace) ||
          airspace_look.thick_pen.GetWidth() >= 2 * screen_radius) {
        // fill whole circle
        canvas.circle(screen_center.x, screen_center.y, screen_radius);
      } else {
        // draw a ring inside the circle
        Color color = airspace_look.colors[settings.colours[airspace.GetType()]];
        Pen pen_donut(airspace_look.thick_pen.GetWidth() / 2, color.WithAlpha(90));
        canvas.SelectHollowBrush();
        canvas.Select(pen_donut);
        canvas.circle(screen_center.x, screen_center.y,
                      screen_radius - airspace_look.thick_pen.GetWidth() / 4);
      }
    }

    // draw outline
    setup_outline(airspace);
    canvas.circle(screen_center.x, screen_center.y, screen_radius);
  }
Beispiel #2
0
  void Visit(const AirspacePolygon& airspace) {
    if (!prepare_polygon(airspace.GetPoints()))
      return;

    bool fill_airspace = m_warnings.is_warning(airspace) ||
                         m_warnings.is_inside(airspace);
    GLEnable stencil(GL_STENCIL_TEST);

    if (!m_warnings.is_acked(airspace)) {
      if (!fill_airspace) {
        // set stencil for filling (bit 0)
        set_fillstencil();
        draw_prepared();
      }

      // fill interior without overpainting any previous outlines
      {
        setup_interior(airspace, !fill_airspace);
        GLEnable blend(GL_BLEND);
        draw_prepared();
      }

      if (!fill_airspace) {
        // clear fill stencil (bit 0)
        clear_fillstencil();
        draw_prepared();
      }
    }

    // draw outline
    setup_outline(airspace);
    draw_prepared();
  }
/**********************************************************************
 * setup_blob_outlines
 *
 * Set up each of the outlines in this blob.
 **********************************************************************/
void setup_blob_outlines(TBLOB *blob) { 
  TESSLINE *outline;

  for (outline = blob->outlines; outline; outline = outline->next) {
    setup_outline(outline); 
  }
}
Beispiel #4
0
  void Visit(const AirspaceCircle& airspace) {
    RasterPoint screen_center = projection.GeoToScreen(airspace.GetCenter());
    unsigned screen_radius = projection.GeoToScreenDistance(airspace.GetRadius());

    {
      GLEnable blend(GL_BLEND);
      setup_interior(airspace);
      canvas.circle(screen_center.x, screen_center.y, screen_radius);
    }

    // draw outline
    setup_outline(airspace);
    canvas.circle(screen_center.x, screen_center.y, screen_radius);
  }
Beispiel #5
0
  void Visit(const AirspacePolygon& airspace) {
    if (!prepare_polygon(airspace.GetPoints()))
      return;

    if (!m_warnings.is_acked(airspace)) {
      // fill interior without overpainting any previous outlines
      {
        setup_interior(airspace);
        GLEnable blend(GL_BLEND);
        draw_prepared();
      }
    }

    // draw outline
    setup_outline(airspace);
    draw_prepared();
  }