45 Q_PROPERTY(
GeoScene* scene READ scene WRITE setScene NOTIFY sceneChanged)
46 Q_PROPERTY(
bool terrain READ terrain WRITE setTerrain NOTIFY terrainChanged)
47 Q_PROPERTY(
bool debugHills READ debugHills WRITE setDebugHills NOTIFY debugHillsChanged)
48 Q_PROPERTY(QString
mapType READ
mapType WRITE setMapType NOTIFY mapTypeChanged)
49 Q_PROPERTY(
int gridSize READ gridSize CONSTANT)
50 Q_PROPERTY(
double maxRangeMultiplier READ maxRangeMultiplier CONSTANT)
51 Q_PROPERTY(
int patchCount READ patchCount NOTIFY statsChanged)
53 Q_PROPERTY(
int maxZoomLevel READ maxZoomLevel NOTIFY statsChanged)
54 Q_PROPERTY(
bool statsEnabled READ statsEnabled WRITE setStatsEnabled NOTIFY statsEnabledChanged)
55 Q_PROPERTY(QString statsText READ statsText NOTIFY statsTextChanged)
56 Q_PROPERTY(
bool capturing READ capturing NOTIFY capturingChanged)
64 CenterXRole = Qt::UserRole + 1,
86 void setTerrain(
bool terrain);
90 void setDebugHills(
bool debugHills);
92 QString
mapType()
const {
return _mapType; }
96 void setMapType(
const QString&
mapType);
107 Q_INVOKABLE
double terrainHeightAt(
const QGeoCoordinate& coordinate)
const;
111 double maxRangeMultiplier()
const;
116 int maxZoomLevel()
const;
125 _tileImageNetworkManager = networkManager;
132 void setStatsEnabled(
bool enabled);
139 Q_INVOKABLE
void startCapture();
143 Q_INVOKABLE QString stopCapture();
148 Q_INVOKABLE
void analyzeSurface()
const;
150#ifdef QGC_UNITTEST_BUILD
155 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
156 QVariant data(
const QModelIndex& index,
int role)
const override;
157 QHash<int, QByteArray> roleNames()
const override;
176 void _sceneOriginChanged();
177 void _tileImageReady(
int requestId,
const QImage& image);
178 void _tileImageFailed(
int requestId);
182 void _rebuildSurfaceModel();
183 void _resetImagery();
185 void _retryFailedImages();
189 void _scheduleStatsChanged();
190 void _startStatsSampling();
195 static constexpr int kMaxRetiredImages = 128;
196 static constexpr int kMaxAncestorFallbackLevels = 8;
197 static constexpr int kImageRetryMs = 3000;
203 bool _terrain =
false;
204 bool _debugHills =
false;
207 QNetworkAccessManager* _tileImageNetworkManager =
nullptr;
208 QHash<TileMath::TileKey, QImage> _tileImages;
212 mutable QHash<TileMath::TileKey, QImage> _fallbackCache;
213 QList<TileMath::TileKey> _retiredOrder;
214 QHash<int, TileMath::TileKey> _imageRequestKey;
215 QHash<TileMath::TileKey, int> _imageRequestByKey;
216 QSet<TileMath::TileKey> _failedImageKeys;
217 QTimer* _imageRetryTimer =
nullptr;
218 QList<TileMath::TileKey> _keys;
221 QTimer* _statsTimer =
nullptr;
222 bool _statsEnabled =
false;
223 bool _statsNotifyPending =
false;
226 int _statRemoves = 0;
227 mutable int _statComposites = 0;
230 bool _capturing =
false;
231 QStringList _captureRows;
232 QElapsedTimer _captureClock;
233 double _captureWorstMaxMs = 0.0;
234 double _captureWorstAvgMs = 0.0;