|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <SurfacePatchModel.h>
Inheritance diagram for SurfacePatchModel:
Collaboration diagram for SurfacePatchModel:Public Types | |
| enum | Roles { CenterXRole = Qt::UserRole + 1 , CenterYRole , SpanRole , ZoomRole , HeightsRole , ReadyRole , CoveredRole , TileImageRole , HasTileImageRole , EdgeLodDeltasRole , TileXRole , TileYRole } |
Signals | |
| void | sceneChanged () |
| void | terrainChanged () |
| void | debugHillsChanged () |
| void | mapTypeChanged () |
| void | statsChanged () |
| void | statsEnabledChanged () |
| void | statsTextChanged () |
| void | capturingChanged () |
| void | terrainHeightsChanged () |
| terrainHeightAt answers changed somewhere: consumers re-query | |
Public Member Functions | |
| SurfacePatchModel (QObject *parent=nullptr) | |
| ~SurfacePatchModel () override | |
| GeoScene * | scene () const |
| void | setScene (GeoScene *scene) |
| bool | terrain () const |
| void | setTerrain (bool terrain) |
| bool | debugHills () const |
| void | setDebugHills (bool debugHills) |
| QString | mapType () const |
| void | setMapType (const QString &mapType) |
| int | gridSize () const |
| HeightField * | heightField () const |
| Q_INVOKABLE double | terrainHeightAt (const QGeoCoordinate &coordinate) const |
| double | maxRangeMultiplier () const |
| int | patchCount () const |
| int | pendingCount () const |
| int | maxZoomLevel () const |
| int | pendingImageCount () const |
| Tile image requests awaiting delivery or failure. | |
| void | setTileImageNetworkManager (QNetworkAccessManager *networkManager) |
| bool | statsEnabled () const |
| void | setStatsEnabled (bool enabled) |
| QString | statsText () const |
| bool | capturing () const |
| Q_INVOKABLE void | startCapture () |
| Starts recording the per-second perf samples (plus camera context) | |
| Q_INVOKABLE QString | stopCapture () |
| Q_INVOKABLE void | analyzeSurface () const |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| QHash< int, QByteArray > | roleNames () const override |
QML bridge between SurfaceModel and the Repeater3D that renders the surface: one row per active patch, updated incrementally (no model resets on pan/zoom).
Patch positions are exposed in scene coordinates (see GeoScene): world mercator meters relative to the scene's re-anchorable origin.
Definition at line 41 of file SurfacePatchModel.h.
Definition at line 62 of file SurfacePatchModel.h.
|
explicit |
Definition at line 29 of file SurfacePatchModel.cc.
|
overridedefault |
| void SurfacePatchModel::analyzeSurface | ( | ) | const |
Diagnostic pass over the current patch set: reports coverage holes, boundary height cliffs, and bad height data, with the reason each exists (see SurfaceAnalysis). The report goes to the debug output.
Definition at line 486 of file SurfacePatchModel.cc.
References SurfaceAnalysis::analyze(), SurfaceAnalysis::ViewState::cameraGround, GeoMapCamera::cameraGroundPosition(), SurfaceAnalysis::ViewState::cameraHeight, GeoMapCamera::centerElevation(), GeoMapCamera::distance(), GeoMapCamera::groundPointCapped(), SurfaceAnalysis::ViewState::groundSamples, SurfaceAnalysis::ViewState::heightScale, SurfaceModel::kGridSize, SurfaceModel::kMaxRangeMultiplier, SurfaceModel::patches(), SurfaceAnalysis::Report::text(), GeoMapCamera::tilt(), GeoScene::verticalScale(), and GeoMapCamera::viewportSize().
|
inline |
Definition at line 136 of file SurfacePatchModel.h.
|
signal |
Referenced by startCapture(), and stopCapture().
|
override |
Definition at line 534 of file SurfacePatchModel.cc.
References CenterXRole, CenterYRole, CoveredRole, SurfaceModel::edgeLodDeltas(), EdgeLodDeltasRole, HasTileImageRole, HeightsRole, SurfaceModel::patch(), ReadyRole, GeoScene::sceneOrigin(), SpanRole, TileImageRole, TileMath::tileMinCorner(), TileMath::tileSpanAtZoom(), TileXRole, TileYRole, TileMath::TileKey::x, TileMath::TileKey::y, TileMath::TileKey::zoom, and ZoomRole.
Referenced by stopCapture().
|
inline |
Definition at line 88 of file SurfacePatchModel.h.
Referenced by setDebugHills().
|
signal |
Referenced by setDebugHills().
| int SurfacePatchModel::gridSize | ( | ) | const |
Definition at line 323 of file SurfacePatchModel.cc.
References SurfaceModel::kGridSize.
|
inline |
The shared terrain field patches sample from. Owned here; replaced whenever the surface model is rebuilt.
Definition at line 102 of file SurfacePatchModel.h.
|
inline |
Definition at line 92 of file SurfacePatchModel.h.
Referenced by setMapType().
|
signal |
Referenced by setMapType().
| double SurfacePatchModel::maxRangeMultiplier | ( | ) | const |
SurfaceModel::kMaxRangeMultiplier, exposed so the scene camera's far clip plane can cover the full retained patch range
Definition at line 328 of file SurfacePatchModel.cc.
References SurfaceModel::kMaxRangeMultiplier.
| int SurfacePatchModel::maxZoomLevel | ( | ) | const |
Definition at line 338 of file SurfacePatchModel.cc.
References TileMath::TileKey::zoom.
|
inline |
Definition at line 113 of file SurfacePatchModel.h.
| int SurfacePatchModel::pendingCount | ( | ) | const |
Definition at line 333 of file SurfacePatchModel.cc.
References SurfaceModel::pendingCount().
|
inline |
Tile image requests awaiting delivery or failure.
Definition at line 119 of file SurfacePatchModel.h.
|
override |
Definition at line 657 of file SurfacePatchModel.cc.
References CenterXRole, CenterYRole, CoveredRole, EdgeLodDeltasRole, HasTileImageRole, HeightsRole, ReadyRole, SpanRole, TileImageRole, TileXRole, TileYRole, and ZoomRole.
|
override |
Definition at line 529 of file SurfacePatchModel.cc.
|
inline |
Definition at line 78 of file SurfacePatchModel.h.
Referenced by setScene().
|
signal |
Referenced by setScene().
| void SurfacePatchModel::setDebugHills | ( | bool | debugHills | ) |
Definition at line 96 of file SurfacePatchModel.cc.
References debugHills(), and debugHillsChanged().
| void SurfacePatchModel::setMapType | ( | const QString & | mapType | ) |
Provider type string for tile imagery (see TileImageSource). Empty disables imagery: TileImageRole stays a null QImage for every patch.
Definition at line 107 of file SurfacePatchModel.cc.
References mapType(), mapTypeChanged(), TileImageSource::tileImageFailed(), and TileImageSource::tileImageReady().
| void SurfacePatchModel::setScene | ( | GeoScene * | scene | ) |
Definition at line 33 of file SurfacePatchModel.cc.
References GeoScene::cameraChanged(), scene(), sceneChanged(), and GeoScene::sceneOriginChanged().
| void SurfacePatchModel::setStatsEnabled | ( | bool | enabled | ) |
Enables the once-per-second perf counter sampling behind statsText: model update rate/duration, patch churn, and fallback composites
Definition at line 363 of file SurfacePatchModel.cc.
References statsEnabledChanged(), and statsTextChanged().
| void SurfacePatchModel::setTerrain | ( | bool | terrain | ) |
Real terrain elevations (see TerrariumTileFetcher); false gives a flat z=0 surface. debugHills overrides either.
Definition at line 85 of file SurfacePatchModel.cc.
References terrain(), and terrainChanged().
|
inline |
Network manager for tile imagery fetches, applied at the next setMapType (test injection seam)
Definition at line 123 of file SurfacePatchModel.h.
| void SurfacePatchModel::startCapture | ( | ) |
Starts recording the per-second perf samples (plus camera context)
Definition at line 421 of file SurfacePatchModel.cc.
References capturingChanged().
|
signal |
|
inline |
Definition at line 128 of file SurfacePatchModel.h.
|
signal |
Referenced by setStatsEnabled().
|
inline |
Definition at line 134 of file SurfacePatchModel.h.
|
signal |
Referenced by setStatsEnabled(), and stopCapture().
| QString SurfacePatchModel::stopCapture | ( | ) |
Stops recording and writes the samples as CSV; returns the file path (empty on write failure)
Definition at line 442 of file SurfacePatchModel.cc.
References capturingChanged(), data(), and statsTextChanged().
|
inline |
Definition at line 82 of file SurfacePatchModel.h.
Referenced by setTerrain().
|
signal |
Referenced by setTerrain().
| double SurfacePatchModel::terrainHeightAt | ( | const QGeoCoordinate & | coordinate | ) | const |
Best-estimate terrain height (true meters) at a coordinate: real data where loaded, coarser estimate or 0 elsewhere (see HeightField). Emits terrainHeightsChanged as estimates improve.
Definition at line 314 of file SurfacePatchModel.cc.
References TileMath::geoToWorld(), and HeightField::heightAt().
|
signal |
terrainHeightAt answers changed somewhere: consumers re-query
Referenced by GeoMapItem::setSurfaceModel().