1/****************************************************************************
3 * (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
5 * QGroundControl is licensed according to the terms in the file
6 * COPYING.md in the root of the source code directory.
8 ****************************************************************************/
13import QGroundControl.Controls
14import QGroundControl.GeoMap
16/// Experimental 2D/3D map view (preview feature): the GeoMap-engine
17/// counterpart of FlyView. View chrome around a FlyViewGeoMap.
21 QGCPalette { id: qgcPal }
25 anchors.left: parent.left
26 anchors.right: parent.right
27 anchors.top: parent.top
28 height: ScreenTools.toolbarHeight
29 color: qgcPal.toolbarBackground
32 objectName: "toolbar_qgcLogo"
34 icon.source: "/res/QGCLogoFull.svg"
36 onClicked: mainWindow.showToolSelectDialog()
40 anchors.centerIn: parent
41 text: qsTr("GeoView (preview)")
42 font.pointSize: ScreenTools.largeFontPointSize
46 // The 3D scene only exists while this is the active view: View3D
47 // costs RHI/scene-graph resources even when hidden.
50 anchors.left: parent.left
51 anchors.right: parent.right
52 anchors.top: toolbar.bottom
53 anchors.bottom: parent.bottom
55 sourceComponent: Item {
61 // Bottom-left overlay: dataset attribution (required by the terrain
62 // tiles' terms) plus live SurfaceModel stats for manual verification;
63 // last line adds the perf counters while Stats is on
65 anchors.left: parent.left
66 anchors.bottom: parent.bottom
67 anchors.margins: ScreenTools.defaultFontPixelWidth / 2
68 width: debugOverlayLabel.implicitWidth + ScreenTools.defaultFontPixelWidth
69 height: debugOverlayLabel.implicitHeight + ScreenTools.defaultFontPixelWidth
70 radius: ScreenTools.defaultFontPixelWidth / 2
71 color: Qt.rgba(0, 0, 0, 0.5)
75 objectName: "flyViewGeoDebugOverlay"
76 anchors.centerIn: parent
77 font.family: ScreenTools.fixedFontFamily
79 text: qsTr("Terrain: Mapzen/Tilezen Terrain Tiles — SRTM (NASA), 3DEP (USGS), GMTED2010, ETOPO1 (NOAA)")
80 + "\n" + qsTr("patches: %1 pending: %2 max zoom: %3")
81 .arg(geoMap.patchCount)
82 .arg(geoMap.pendingCount)
83 .arg(geoMap.maxZoomLevel)
84 + (geoMap.modelStats !== "" ? "\n" + geoMap.modelStats : "")
89 anchors.right: parent.right
90 anchors.top: parent.top
91 anchors.margins: ScreenTools.defaultFontPixelWidth
92 spacing: ScreenTools.defaultFontPixelHeight / 2
94 // 2D<->3D mode switch: the mode flips immediately (2D locks tilt
95 // gestures); GeoMap's mode-change handler animates tilt and terrain
97 objectName: "flyViewGeoModeButton"
98 text: geoMap.camera.mode === GeoMapCamera.Mode2D ? qsTr("3D") : qsTr("2D")
99 onClicked: geoMap.camera.mode = (geoMap.camera.mode === GeoMapCamera.Mode2D)
100 ? GeoMapCamera.Mode3D : GeoMapCamera.Mode2D
103 // Compass: needle tracks heading, click animates back to north-up
105 objectName: "flyViewGeoCompassButton"
107 rotation: -geoMap.camera.heading
108 onClicked: geoMap.animateHeadingToNorth()
111 // Diagnostic: report holes, terrain cliffs, and bad height
112 // data to the debug output
114 objectName: "flyViewGeoAnalyzeButton"
115 text: qsTr("Analyze")
116 onClicked: geoMap.analyzeSurface()
119 // Render-statistics overlay toggle (perf diagnostics)
121 objectName: "flyViewGeoStatsButton"
123 onClicked: geoMap.renderStats = !geoMap.renderStats
126 // Perf capture: records per-second counters; the CSV path
127 // shows in the debug overlay when stopped
129 objectName: "flyViewGeoRecordButton"
130 text: geoMap.perfCapturing ? qsTr("Stop") : qsTr("Record")
131 onClicked: geoMap.perfCapturing ? geoMap.stopPerfCapture() : geoMap.startPerfCapture()