示例#1
0
  void VisitPolygon(const AirspacePolygon &airspace) {
    if (warnings.IsAcked(airspace))
      return;

    AirspaceClass airspace_class = airspace.GetType();
    if (settings.classes[airspace_class].fill_mode ==
        AirspaceClassRendererSettings::FillMode::NONE)
      return;

    BufferRenderStart();
    SetBufferPens(airspace);
    DrawSearchPointVector(airspace.GetPoints());
  }
示例#2
0
  void VisitPolygon(const AirspacePolygon &airspace) {
    if (!PreparePolygon(airspace.GetPoints()))
      return;

    bool fill_airspace = warning_manager.HasWarning(airspace) ||
                         warning_manager.IsInside(airspace) ||
                         settings.classes[airspace.GetType()].fill_mode ==
                         AirspaceClassRendererSettings::FillMode::ALL;
    GLEnable stencil(GL_STENCIL_TEST);

    if (!warning_manager.IsAcked(airspace) &&
        settings.classes[airspace.GetType()].fill_mode !=
        AirspaceClassRendererSettings::FillMode::NONE) {
      if (!fill_airspace) {
        // set stencil for filling (bit 0)
        SetFillStencil();
        DrawPrepared();
      }

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

      if (!fill_airspace) {
        // clear fill stencil (bit 0)
        ClearFillStencil();
        DrawPrepared();
      }
    }

    // draw outline
    if (SetupOutline(airspace))
      DrawPrepared();
  }