#include <GeoMapItem.h>
Public Types | |
| enum class | AltitudeMode { ClampToGround , Absolute } |
| How the coordinate's vertical position is resolved. More... | |
Signals | |
| void | coordinateChanged () |
| void | anchorPointChanged () |
| void | sceneChanged () |
| void | surfaceModelChanged () |
| void | altitudeModeChanged () |
| void | projectedChanged () |
| void | scenePositionChanged () |
| void | delegate3DChanged () |
| void | node3DChanged () |
| void | crossfade3DChanged () |
| void | node3DOpacityChanged () |
| void | contentOpacity2DChanged () |
Public Member Functions | |
| GeoMapItem (QQuickItem *parent=nullptr) | |
| ~GeoMapItem () override | |
| QGeoCoordinate | coordinate () const |
| void | setCoordinate (const QGeoCoordinate &coordinate) |
| QPointF | anchorPoint () const |
| void | setAnchorPoint (const QPointF &anchorPoint) |
| GeoScene * | scene () const |
| void | setScene (GeoScene *scene) |
| SurfacePatchModel * | surfaceModel () const |
| void | setSurfaceModel (SurfacePatchModel *surfaceModel) |
| AltitudeMode | altitudeMode () const |
| void | setAltitudeMode (AltitudeMode mode) |
| bool | projected () const |
| QVector3D | scenePosition () const |
| QQmlComponent * | delegate3D () const |
| void | setDelegate3D (QQmlComponent *delegate3D) |
| QObject * | node3D () const |
| bool | crossfade3D () const |
| void | setCrossfade3D (bool crossfade3D) |
| qreal | node3DOpacity () const |
| void | setNode3DOpacity (qreal node3DOpacity) |
| qreal | contentOpacity2D () const |
GeoMap counterpart of QtLocation's MapQuickItem: anchors its QML content at a geographic coordinate, projected through the scene's camera into the 2D overlay above the View3D. Meant to be used as the base of marker controls (e.g. GeoMapPin) that declare their visuals as ordinary children. The item tracks camera pose, scene re-anchoring, terrain-scale transitions, and (in ClampToGround mode) terrain height refinement. While the coordinate is behind the camera or beyond the horizon the item parks off-screen and projected is false.
Consumers parent the item into the GeoMap control and wire scene (required) and surfaceModel (required for ClampToGround) from the map's properties.
Definition at line 38 of file GeoMapItem.h.
|
strong |
How the coordinate's vertical position is resolved.
| Enumerator | |
|---|---|
| ClampToGround | sit on the rendered terrain surface (default) |
| Absolute | use coordinate.altitude (NaN treated as 0) |
Definition at line 60 of file GeoMapItem.h.
|
explicit |
Definition at line 29 of file GeoMapItem.cc.
|
override |
Definition at line 34 of file GeoMapItem.cc.
|
inline |
Definition at line 85 of file GeoMapItem.h.
|
signal |
Referenced by setAltitudeMode().
|
inline |
Pixel offset from this item's top-left placed at the projected coordinate (e.g. the tip of a pin, or the center for a centered marker)
Definition at line 73 of file GeoMapItem.h.
Referenced by setAnchorPoint().
|
signal |
Referenced by setAnchorPoint().
|
inline |
Opacity for this item's 2D visuals: fades out during the 2D->3D transition when a delegate3D is set, 1.0 otherwise. Bind children's opacity to it (multiplying any dimming of their own).
Definition at line 127 of file GeoMapItem.h.
|
signal |
References ClampToGround, projected(), and scenePosition().
|
inline |
Definition at line 67 of file GeoMapItem.h.
References coordinate().
Referenced by coordinate(), and setCoordinate().
|
signal |
Referenced by setCoordinate().
|
inline |
Whether the delegate3D node crossfades with 2D content during the 2D<->3D transition (default). When false the node stays fully opaque in both modes (for items with no 2D counterpart, e.g. the flight path).
Definition at line 114 of file GeoMapItem.h.
Referenced by setCrossfade3D().
|
signal |
Referenced by setCrossfade3D().
|
inline |
Optional 3D counterpart of this item's 2D visuals: a QQuick3DNode component instantiated into the scene's content3D container. The item keeps the node's position on scenePosition, crossfades node opacity (terrainScale) against contentOpacity2D (1 - terrainScale), and syncs node visibility to this item's visible and coordinate validity.
Definition at line 103 of file GeoMapItem.h.
Referenced by setDelegate3D().
|
signal |
Referenced by setDelegate3D().
|
inline |
The instantiated delegate3D node (null while there is no delegate, scene or content3D container)
Definition at line 109 of file GeoMapItem.h.
|
signal |
|
inline |
Dimming of the delegate3D node on top of the crossfade (1.0 = none). The node does not follow the QQuickItem opacity of this item or its ancestors, so views that dim their 2D content set this too.
Definition at line 120 of file GeoMapItem.h.
Referenced by setNode3DOpacity().
|
signal |
Referenced by setNode3DOpacity().
|
inline |
False while the coordinate cannot be projected on screen (invalid, no camera, behind the camera or beyond the horizon)
Definition at line 91 of file GeoMapItem.h.
Referenced by contentOpacity2DChanged().
|
signal |
|
inline |
Definition at line 77 of file GeoMapItem.h.
Referenced by setScene().
|
signal |
Referenced by setScene().
|
inline |
Origin-relative scene position of the coordinate (z pre-scaled by verticalScale and terrainScale), matching the rendered surface. Valid even while not projected, so 3D content can bind to it directly.
Definition at line 96 of file GeoMapItem.h.
Referenced by contentOpacity2DChanged().
|
signal |
| void GeoMapItem::setAltitudeMode | ( | AltitudeMode | mode | ) |
Definition at line 109 of file GeoMapItem.cc.
References altitudeModeChanged().
| void GeoMapItem::setAnchorPoint | ( | const QPointF & | anchorPoint | ) |
Definition at line 50 of file GeoMapItem.cc.
References anchorPoint(), and anchorPointChanged().
| void GeoMapItem::setCoordinate | ( | const QGeoCoordinate & | coordinate | ) |
Definition at line 39 of file GeoMapItem.cc.
References coordinate(), and coordinateChanged().
| void GeoMapItem::setCrossfade3D | ( | bool | crossfade3D | ) |
Definition at line 140 of file GeoMapItem.cc.
References crossfade3D(), and crossfade3DChanged().
| void GeoMapItem::setDelegate3D | ( | QQmlComponent * | delegate3D | ) |
Definition at line 119 of file GeoMapItem.cc.
References delegate3D(), and delegate3DChanged().
| void GeoMapItem::setNode3DOpacity | ( | qreal | node3DOpacity | ) |
Definition at line 150 of file GeoMapItem.cc.
References node3DOpacity(), and node3DOpacityChanged().
| void GeoMapItem::setScene | ( | GeoScene * | scene | ) |
Definition at line 60 of file GeoMapItem.cc.
References GeoScene::cameraChanged(), GeoScene::content3DChanged(), scene(), sceneChanged(), GeoScene::sceneOriginChanged(), and GeoScene::terrainScaleChanged().
| void GeoMapItem::setSurfaceModel | ( | SurfacePatchModel * | surfaceModel | ) |
Definition at line 88 of file GeoMapItem.cc.
References surfaceModel(), surfaceModelChanged(), and SurfacePatchModel::terrainHeightsChanged().
|
inline |
Definition at line 81 of file GeoMapItem.h.
Referenced by setSurfaceModel().
|
signal |
Referenced by setSurfaceModel().