void TargetMapWindow::OnPaintBuffer(Canvas &canvas) { #ifdef ENABLE_OPENGL /* enable clipping */ GLCanvasScissor scissor(canvas); #endif // Calculate screen position of the aircraft const auto aircraft_pos = projection.GeoToScreen(Basic().location); // reset label over-write preventer label_block.reset(); // Render terrain, groundline and topography RenderTerrain(canvas); RenderTopography(canvas); // Render airspace RenderAirspace(canvas); #ifdef ENABLE_OPENGL /* desaturate the map background, to focus on the task */ canvas.FadeToWhite(0x80); #endif // Render task, waypoints DrawTask(canvas); DrawWaypoints(canvas); // Render the snail trail RenderTrail(canvas); // Render topography on top of airspace, to keep the text readable RenderTopographyLabels(canvas); // Finally, draw you! if (Basic().alive) AircraftRenderer::Draw(canvas, GetMapSettings(), aircraft_look, Basic().attitude.heading - projection.GetScreenAngle(), aircraft_pos); RenderMapScale(canvas, projection, GetClientRect(), overlay_look); }
void TargetMapWindow::on_paint_buffer(Canvas &canvas) { #ifdef ENABLE_OPENGL /* enable clipping */ GLCanvasScissor scissor(canvas); #endif // Calculate screen position of the aircraft const RasterPoint aircraft_pos = projection.GeoToScreen(Basic().location); // reset label over-write preventer label_block.reset(); // Render terrain, groundline and topography RenderTerrain(canvas); RenderTopography(canvas); // Render airspace RenderAirspace(canvas); // Render task, waypoints DrawTask(canvas); DrawWaypoints(canvas); // Render the snail trail RenderTrail(canvas); // Render topography on top of airspace, to keep the text readable RenderTopographyLabels(canvas); // Finally, draw you! if (Basic().connected) AircraftRenderer::Draw(canvas, SettingsMap(), aircraft_look, Calculated().heading - projection.GetScreenAngle(), aircraft_pos); }
void MapWindow::Render(Canvas &canvas, const PixelRect &rc) { render_projection = visible_projection; // Calculate screen position of the aircraft const RasterPoint aircraft_pos = render_projection.GeoToScreen(Basic().Location); // reset label over-write preventer label_block.reset(); // Render terrain, groundline and topography RenderTerrain(canvas); RenderTopography(canvas); RenderFinalGlideShading(canvas); // Render track bearing (ground track) DrawTrackBearing(canvas, aircraft_pos); // Render airspace RenderAirspace(canvas); // Render task, waypoints DrawTask(canvas); DrawWaypoints(canvas); // Render weather/terrain max/min values if (!m_background.DrawSpotHeights(canvas, label_block)) DrawTaskOffTrackIndicator(canvas); // Render the snail trail RenderTrail(canvas, aircraft_pos); RenderMarks(canvas); // Render estimate of thermal location DrawThermalEstimate(canvas); // Render topography on top of airspace, to keep the text readable RenderTopographyLabels(canvas); // Render glide through terrain range RenderGlide(canvas); DrawBestCruiseTrack(canvas, aircraft_pos); DrawAirspaceIntersections(canvas); // Draw wind vector at aircraft DrawWind(canvas, aircraft_pos, rc); // Draw traffic DrawTeammate(canvas); DrawFLARMTraffic(canvas, aircraft_pos); // Finally, draw you! if (Basic().Connected) Graphics::DrawAircraft(canvas, settings_map, Calculated().Heading - render_projection.GetScreenAngle(), aircraft_pos); // Render compass DrawCompass(canvas, rc); }
void MapWindow::Render(Canvas &canvas, const PixelRect &rc) { const NMEAInfo &basic = Basic(); // reset label over-write preventer label_block.reset(); render_projection = visible_projection; if (!render_projection.IsValid()) { canvas.ClearWhite(); return; } // Calculate screen position of the aircraft RasterPoint aircraft_pos{0,0}; if (basic.location_available) aircraft_pos = render_projection.GeoToScreen(basic.location); // Render terrain, groundline and topography draw_sw.Mark("RenderTerrain"); RenderTerrain(canvas); draw_sw.Mark("RenderTopography"); RenderTopography(canvas); draw_sw.Mark("RenderFinalGlideShading"); RenderFinalGlideShading(canvas); // Render track bearing (ground track) draw_sw.Mark("DrawTrackBearing"); DrawTrackBearing(canvas, aircraft_pos); // Render airspace draw_sw.Mark("RenderAirspace"); RenderAirspace(canvas); // Render task, waypoints draw_sw.Mark("DrawContest"); DrawContest(canvas); draw_sw.Mark("DrawTask"); DrawTask(canvas); draw_sw.Mark("DrawWaypoints"); DrawWaypoints(canvas); draw_sw.Mark("DrawNOAAStations"); RenderNOAAStations(canvas); draw_sw.Mark("RenderMisc1"); // Render weather/terrain max/min values DrawTaskOffTrackIndicator(canvas); // Render the snail trail if (basic.location_available) RenderTrail(canvas, aircraft_pos); RenderMarkers(canvas); // Render estimate of thermal location DrawThermalEstimate(canvas); // Render topography on top of airspace, to keep the text readable draw_sw.Mark("RenderTopographyLabels"); RenderTopographyLabels(canvas); // Render glide through terrain range draw_sw.Mark("RenderGlide"); RenderGlide(canvas); draw_sw.Mark("RenderMisc2"); DrawBestCruiseTrack(canvas, aircraft_pos); airspace_renderer.DrawIntersections(canvas, render_projection); // Draw wind vector at aircraft if (basic.location_available) DrawWind(canvas, aircraft_pos, rc); // Draw traffic #ifdef HAVE_SKYLINES_TRACKING_HANDLER DrawSkyLinesTraffic(canvas); #endif DrawTeammate(canvas); if (basic.location_available) DrawFLARMTraffic(canvas, aircraft_pos); // Finally, draw you! if (basic.location_available) AircraftRenderer::Draw(canvas, GetMapSettings(), look.aircraft, basic.attitude.heading - render_projection.GetScreenAngle(), aircraft_pos); // Render compass DrawCompass(canvas, rc); }
void MapWindow::Render(Canvas &canvas, const PixelRect &rc) { const NMEAInfo &basic = Basic(); // reset label over-write preventer label_block.reset(); render_projection = visible_projection; if (!render_projection.IsValid()) { canvas.ClearWhite(); return; } // Calculate screen position of the aircraft PixelPoint aircraft_pos{0,0}; if (basic.location_available) aircraft_pos = render_projection.GeoToScreen(basic.location); // General layout principles: // - lower elevation drawn on bottom layers // - increasing elevation drawn above // - increasing importance drawn above // - attempt to not obscure text //////////////////////////////////////////////// items on ground // Render terrain, groundline and topography draw_sw.Mark("RenderTerrain"); RenderTerrain(canvas); draw_sw.Mark("RenderRasp"); RenderRasp(canvas); draw_sw.Mark("RenderTopography"); RenderTopography(canvas); draw_sw.Mark("RenderOverlays"); RenderOverlays(canvas); draw_sw.Mark("DrawNOAAStations"); RenderNOAAStations(canvas); //////////////////////////////////////////////// glide range info draw_sw.Mark("RenderFinalGlideShading"); RenderFinalGlideShading(canvas); //////////////////////////////////////////////// airspace // Render airspace draw_sw.Mark("RenderAirspace"); RenderAirspace(canvas); //////////////////////////////////////////////// task // Render task, waypoints draw_sw.Mark("DrawContest"); DrawContest(canvas); draw_sw.Mark("DrawTask"); DrawTask(canvas); draw_sw.Mark("DrawWaypoints"); DrawWaypoints(canvas); //////////////////////////////////////////////// aircraft level items // Render the snail trail if (basic.location_available) RenderTrail(canvas, aircraft_pos); DrawWaves(canvas); // Render estimate of thermal location DrawThermalEstimate(canvas); //////////////////////////////////////////////// text items // Render topography on top of airspace, to keep the text readable draw_sw.Mark("RenderTopographyLabels"); RenderTopographyLabels(canvas); //////////////////////////////////////////////// navigation overlays // Render glide through terrain range draw_sw.Mark("RenderGlide"); RenderGlide(canvas); draw_sw.Mark("RenderMisc1"); // Render weather/terrain max/min values DrawTaskOffTrackIndicator(canvas); // Render track bearing (projected track ground/air relative) draw_sw.Mark("DrawTrackBearing"); RenderTrackBearing(canvas, aircraft_pos); draw_sw.Mark("RenderMisc2"); DrawBestCruiseTrack(canvas, aircraft_pos); // Draw wind vector at aircraft if (basic.location_available) DrawWind(canvas, aircraft_pos, rc); // Render compass DrawCompass(canvas, rc); //////////////////////////////////////////////// traffic // Draw traffic #ifdef HAVE_SKYLINES_TRACKING DrawSkyLinesTraffic(canvas); #endif DrawTeammate(canvas); if (basic.location_available) DrawFLARMTraffic(canvas, aircraft_pos); //////////////////////////////////////////////// own aircraft // Finally, draw you! if (basic.location_available) AircraftRenderer::Draw(canvas, GetMapSettings(), look.aircraft, basic.attitude.heading - render_projection.GetScreenAngle(), aircraft_pos); //////////////////////////////////////////////// important overlays // Draw intersections on top of aircraft airspace_renderer.DrawIntersections(canvas, render_projection); }