47 Q_PROPERTY(
GeoScene* scene READ scene WRITE setScene NOTIFY sceneChanged)
48 Q_PROPERTY(
bool terrain READ terrain WRITE setTerrain NOTIFY terrainChanged)
49 Q_PROPERTY(
bool debugHills READ debugHills WRITE setDebugHills NOTIFY debugHillsChanged)
50 Q_PROPERTY(QString
mapType READ
mapType WRITE setMapType NOTIFY mapTypeChanged)
51 Q_PROPERTY(
int gridSize READ gridSize CONSTANT)
52 Q_PROPERTY(
double maxRangeMultiplier READ maxRangeMultiplier CONSTANT)
53 Q_PROPERTY(
int patchCount READ patchCount NOTIFY statsChanged)
55 Q_PROPERTY(
int maxZoomLevel READ maxZoomLevel NOTIFY statsChanged)
56 Q_PROPERTY(
bool statsEnabled READ statsEnabled WRITE setStatsEnabled NOTIFY statsEnabledChanged)
57 Q_PROPERTY(QString statsText READ statsText NOTIFY statsTextChanged)
58 Q_PROPERTY(
bool capturing READ capturing NOTIFY capturingChanged)
66 CenterXRole = Qt::UserRole + 1,
88 void setTerrain(
bool terrain);
92 void setDebugHills(
bool debugHills);
94 QString
mapType()
const {
return _mapType; }
98 void setMapType(
const QString&
mapType);
100 int gridSize()
const;
110 Q_INVOKABLE
double terrainHeightAt(
const QGeoCoordinate& coordinate)
const;
116 Q_INVOKABLE
double terrainDataHeightAt(
const QGeoCoordinate& coordinate)
const;
122 Q_INVOKABLE
bool segmentBelowTerrain(
const QGeoCoordinate& from,
const QGeoCoordinate& to,
double ignoreStartMeters,
123 double ignoreEndMeters)
const;
132 Q_INVOKABLE QGeoCoordinate surfaceCoordinateAtScreenPoint(
const GeoMapCamera* camera,
const QPointF& screenPos,
133 double zScale)
const;
137 double maxRangeMultiplier()
const;
142 int maxZoomLevel()
const;
151 _tileImageNetworkManager = networkManager;
158 void setStatsEnabled(
bool enabled);
165 Q_INVOKABLE
void startCapture();
169 Q_INVOKABLE QString stopCapture();
174 Q_INVOKABLE
void analyzeSurface()
const;
176#ifdef QGC_UNITTEST_BUILD
181 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
182 QVariant data(
const QModelIndex& index,
int role)
const override;
183 QHash<int, QByteArray> roleNames()
const override;
204 void _sceneOriginChanged();
205 void _tileImageReady(
int requestId,
const QImage& image);
206 void _tileImageFailed(
int requestId);
210 void _rebuildSurfaceModel();
211 double _surfaceHeightAt(
const QPointF& world)
const;
212 void _resetImagery();
214 void _retryFailedImages();
218 void _scheduleStatsChanged();
219 void _startStatsSampling();
226 static constexpr int kMaxRetiredImages = 128;
227 static constexpr int kMaxAncestorFallbackLevels = 8;
228 static constexpr int kImageRetryMs = 3000;
229 static constexpr double kSegmentSampleSpacingMeters = 30.0;
230 static constexpr int kMaxSegmentSamples = 2000;
236 bool _terrain =
false;
237 bool _debugHills =
false;
240 QNetworkAccessManager* _tileImageNetworkManager =
nullptr;
241 QHash<TileMath::TileKey, QImage> _tileImages;
245 mutable QHash<TileMath::TileKey, QImage> _fallbackCache;
246 QList<TileMath::TileKey> _retiredOrder;
247 QHash<int, TileMath::TileKey> _imageRequestKey;
248 QHash<TileMath::TileKey, int> _imageRequestByKey;
249 QSet<TileMath::TileKey> _failedImageKeys;
250 QTimer* _imageRetryTimer =
nullptr;
251 QList<TileMath::TileKey> _keys;
254 QTimer* _statsTimer =
nullptr;
255 bool _statsEnabled =
false;
256 bool _statsNotifyPending =
false;
259 int _statRemoves = 0;
260 mutable int _statComposites = 0;
263 bool _capturing =
false;
264 QStringList _captureRows;
265 QElapsedTimer _captureClock;
266 double _captureWorstMaxMs = 0.0;
267 double _captureWorstAvgMs = 0.0;