|
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 | |
| void | terrainDataChanged () |
| terrainDataHeightAt / segmentBelowTerrain answers changed somewhere (not on patch churn) | |
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 |
| Q_INVOKABLE double | terrainDataHeightAt (const QGeoCoordinate &coordinate) const |
| Q_INVOKABLE bool | segmentBelowTerrain (const QGeoCoordinate &from, const QGeoCoordinate &to, double ignoreStartMeters, double ignoreEndMeters) const |
| Q_INVOKABLE QGeoCoordinate | surfaceCoordinateAtScreenPoint (const GeoMapCamera *camera, const QPointF &screenPos, double zScale) 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 43 of file SurfacePatchModel.h.
Definition at line 64 of file SurfacePatchModel.h.
|
explicit |
Definition at line 35 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 647 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 162 of file SurfacePatchModel.h.
|
signal |
Referenced by startCapture(), and stopCapture().
|
override |
Definition at line 697 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 90 of file SurfacePatchModel.h.
Referenced by setDebugHills().
|
signal |
Referenced by setDebugHills().
| int SurfacePatchModel::gridSize | ( | ) | const |
Definition at line 469 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 104 of file SurfacePatchModel.h.
|
inline |
Definition at line 94 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 474 of file SurfacePatchModel.cc.
References SurfaceModel::kMaxRangeMultiplier.
| int SurfacePatchModel::maxZoomLevel | ( | ) | const |
Definition at line 484 of file SurfacePatchModel.cc.
References TileMath::TileKey::zoom.
|
inline |
Definition at line 139 of file SurfacePatchModel.h.
| int SurfacePatchModel::pendingCount | ( | ) | const |
Definition at line 479 of file SurfacePatchModel.cc.
References SurfaceModel::pendingCount().
|
inline |
Tile image requests awaiting delivery or failure.
Definition at line 145 of file SurfacePatchModel.h.
|
override |
Definition at line 833 of file SurfacePatchModel.cc.
References CenterXRole, CenterYRole, CoveredRole, EdgeLodDeltasRole, HasTileImageRole, HeightsRole, ReadyRole, SpanRole, TileImageRole, TileXRole, TileYRole, and ZoomRole.
|
override |
Definition at line 692 of file SurfacePatchModel.cc.
|
inline |
Definition at line 80 of file SurfacePatchModel.h.
Referenced by setScene().
|
signal |
Referenced by setScene().
| bool SurfacePatchModel::segmentBelowTerrain | ( | const QGeoCoordinate & | from, |
| const QGeoCoordinate & | to, | ||
| double | ignoreStartMeters, | ||
| double | ignoreEndMeters | ||
| ) | const |
True when the straight segment from -> to (altitude linear along it, in the field's frame) passes strictly below the field's estimate anywhere outside the first ignoreStartMeters and last ignoreEndMeters. False when either end has no altitude.
Definition at line 340 of file SurfacePatchModel.cc.
References TileMath::geoToWorld(), and HeightField::heightAt().
| void SurfacePatchModel::setDebugHills | ( | bool | debugHills | ) |
Definition at line 102 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 113 of file SurfacePatchModel.cc.
References mapType(), mapTypeChanged(), TileImageSource::tileImageFailed(), and TileImageSource::tileImageReady().
| void SurfacePatchModel::setScene | ( | GeoScene * | scene | ) |
Definition at line 39 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 510 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 91 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 149 of file SurfacePatchModel.h.
| void SurfacePatchModel::startCapture | ( | ) |
Starts recording the per-second perf samples (plus camera context)
Definition at line 572 of file SurfacePatchModel.cc.
References capturingChanged().
|
signal |
|
inline |
Definition at line 154 of file SurfacePatchModel.h.
|
signal |
Referenced by setStatsEnabled().
|
inline |
Definition at line 160 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 593 of file SurfacePatchModel.cc.
References capturingChanged(), data(), and statsTextChanged().
| QGeoCoordinate SurfacePatchModel::surfaceCoordinateAtScreenPoint | ( | const GeoMapCamera * | camera, |
| const QPointF & | screenPos, | ||
| double | zScale | ||
| ) | const |
Coordinate of the rendered surface under screenPos: marches the camera's pick ray to its first crossing of z = terrain height(x, y) * zScale, so the pick lands on the visible front surface and ridges occlude the ground behind them. zScale is the height-to-scene-z factor (verticalScale * terrainScale, never negative); 0 reduces to a flat z=0 plane pick. The march is capped at the rendered range (maxRangeMultiplier * camera distance). Invalid coordinate when nothing is hit (sky pick) or camera is null.
Definition at line 376 of file SurfacePatchModel.cc.
References GeoMapCamera::PickRay::dirX, GeoMapCamera::PickRay::dirY, GeoMapCamera::PickRay::dirZ, GeoMapCamera::distance(), SurfaceModel::kMaxRangeMultiplier, GeoMapCamera::PickRay::originX, GeoMapCamera::PickRay::originY, GeoMapCamera::PickRay::originZ, GeoMapCamera::pickRayAt(), and TileMath::worldToGeo().
|
inline |
Definition at line 84 of file SurfacePatchModel.h.
Referenced by setTerrain().
|
signal |
Referenced by setTerrain().
|
signal |
terrainDataHeightAt / segmentBelowTerrain answers changed somewhere (not on patch churn)
| double SurfacePatchModel::terrainDataHeightAt | ( | const QGeoCoordinate & | coordinate | ) | const |
The field's estimate alone (see HeightField), independent of the drawn detail level: for the camera pivot and altitude datums, where following the mesh would couple them to patch churn. Emits terrainDataChanged when it changes.
Definition at line 332 of file SurfacePatchModel.cc.
References TileMath::geoToWorld(), and HeightField::heightAt().
| double SurfacePatchModel::terrainHeightAt | ( | const QGeoCoordinate & | coordinate | ) | const |
Terrain height (true meters) at a coordinate as rendered: the patch mesh where a patch draws, else the field's estimate (real data, coarser estimate, or 0; see HeightField). Emits terrainHeightsChanged when either changes.
Definition at line 323 of file SurfacePatchModel.cc.
References TileMath::geoToWorld().
|
signal |
terrainHeightAt answers changed somewhere: consumers re-query
Referenced by FenceWallGeometry::setSurfaceModel(), GeoMapItem::setSurfaceModel(), GeoMapProjectedPath::setSurfaceModel(), and GeoMapSpriteLayer::setSurfaceModel().