virtual void Visit(const AbstractAirspace &airspace) override { switch (airspace.GetShape()) { case AbstractAirspace::Shape::CIRCLE: VisitCircle((const AirspaceCircle &)airspace); break; case AbstractAirspace::Shape::POLYGON: VisitPolygon((const AirspacePolygon &)airspace); break; } }
void AirspaceVisitor::Visit(const AbstractAirspace &aa) { switch (aa.GetShape()) { case AbstractAirspace::Shape::CIRCLE: Visit((const AirspaceCircle &)aa); break; case AbstractAirspace::Shape::POLYGON: Visit((const AirspacePolygon &)aa); break; } }
void Visit(const AbstractAirspace &airspace) { if (!SetupCanvas(airspace)) return; switch (airspace.GetShape()) { case AbstractAirspace::Shape::CIRCLE: VisitCircle((const AirspaceCircle &)airspace); break; case AbstractAirspace::Shape::POLYGON: VisitPolygon((const AirspacePolygon &)airspace); break; } }
void AirspacePreviewRenderer::Draw(Canvas &canvas, const AbstractAirspace &airspace, const RasterPoint pt, unsigned radius, const AirspaceRendererSettings &settings, const AirspaceLook &look) { AbstractAirspace::Shape shape = airspace.GetShape(); AirspaceClass type = airspace.GetType(); // Container for storing the points of a polygon airspace std::vector<RasterPoint> pts; if (shape == AbstractAirspace::Shape::POLYGON && !IsAncientHardware()) GetPolygonPoints(pts, (const AirspacePolygon &)airspace, pt, radius); if (PrepareFill(canvas, type, look, settings)) { DrawShape(canvas, shape, pt, radius, pts); UnprepareFill(canvas); } if (PrepareOutline(canvas, type, look, settings)) DrawShape(canvas, shape, pt, radius, pts); }
virtual void Visit(const AbstractAirspace &airspace) override { if (warnings.IsAcked(airspace)) return; AirspaceClass airspace_class = airspace.GetType(); if (settings.fill_mode == AirspaceRendererSettings::FillMode::NONE || settings.classes[airspace_class].fill_mode == AirspaceClassRendererSettings::FillMode::NONE) return; Begin(); SetBufferPens(airspace); switch (airspace.GetShape()) { case AbstractAirspace::Shape::CIRCLE: VisitCircle((const AirspaceCircle &)airspace); break; case AbstractAirspace::Shape::POLYGON: VisitPolygon((const AirspacePolygon &)airspace); break; } }