QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GeoMapItem Class Reference

#include <GeoMapItem.h>

Inheritance diagram for GeoMapItem:
Collaboration diagram for GeoMapItem:

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

Detailed Description

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.

Member Enumeration Documentation

◆ AltitudeMode

enum class GeoMapItem::AltitudeMode
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.

Constructor & Destructor Documentation

◆ GeoMapItem()

GeoMapItem::GeoMapItem ( QQuickItem * parent = nullptr)
explicit

Definition at line 29 of file GeoMapItem.cc.

◆ ~GeoMapItem()

GeoMapItem::~GeoMapItem ( )
override

Definition at line 34 of file GeoMapItem.cc.

Member Function Documentation

◆ altitudeMode()

AltitudeMode GeoMapItem::altitudeMode ( ) const
inline

Definition at line 85 of file GeoMapItem.h.

◆ altitudeModeChanged

void GeoMapItem::altitudeModeChanged ( )
signal

Referenced by setAltitudeMode().

◆ anchorPoint()

QPointF GeoMapItem::anchorPoint ( ) const
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().

◆ anchorPointChanged

void GeoMapItem::anchorPointChanged ( )
signal

Referenced by setAnchorPoint().

◆ contentOpacity2D()

qreal GeoMapItem::contentOpacity2D ( ) const
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.

◆ contentOpacity2DChanged

void GeoMapItem::contentOpacity2DChanged ( )
signal

◆ coordinate()

QGeoCoordinate GeoMapItem::coordinate ( ) const
inline

Definition at line 67 of file GeoMapItem.h.

References coordinate().

Referenced by coordinate(), and setCoordinate().

◆ coordinateChanged

void GeoMapItem::coordinateChanged ( )
signal

Referenced by setCoordinate().

◆ crossfade3D()

bool GeoMapItem::crossfade3D ( ) const
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().

◆ crossfade3DChanged

void GeoMapItem::crossfade3DChanged ( )
signal

Referenced by setCrossfade3D().

◆ delegate3D()

QQmlComponent * GeoMapItem::delegate3D ( ) const
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().

◆ delegate3DChanged

void GeoMapItem::delegate3DChanged ( )
signal

Referenced by setDelegate3D().

◆ node3D()

QObject * GeoMapItem::node3D ( ) const
inline

The instantiated delegate3D node (null while there is no delegate, scene or content3D container)

Definition at line 109 of file GeoMapItem.h.

◆ node3DChanged

void GeoMapItem::node3DChanged ( )
signal

◆ node3DOpacity()

qreal GeoMapItem::node3DOpacity ( ) const
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().

◆ node3DOpacityChanged

void GeoMapItem::node3DOpacityChanged ( )
signal

Referenced by setNode3DOpacity().

◆ projected()

bool GeoMapItem::projected ( ) const
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().

◆ projectedChanged

void GeoMapItem::projectedChanged ( )
signal

◆ scene()

GeoScene * GeoMapItem::scene ( ) const
inline

Definition at line 77 of file GeoMapItem.h.

Referenced by setScene().

◆ sceneChanged

void GeoMapItem::sceneChanged ( )
signal

Referenced by setScene().

◆ scenePosition()

QVector3D GeoMapItem::scenePosition ( ) const
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().

◆ scenePositionChanged

void GeoMapItem::scenePositionChanged ( )
signal

◆ setAltitudeMode()

void GeoMapItem::setAltitudeMode ( AltitudeMode mode)

Definition at line 109 of file GeoMapItem.cc.

References altitudeModeChanged().

◆ setAnchorPoint()

void GeoMapItem::setAnchorPoint ( const QPointF & anchorPoint)

Definition at line 50 of file GeoMapItem.cc.

References anchorPoint(), and anchorPointChanged().

◆ setCoordinate()

void GeoMapItem::setCoordinate ( const QGeoCoordinate & coordinate)

Definition at line 39 of file GeoMapItem.cc.

References coordinate(), and coordinateChanged().

◆ setCrossfade3D()

void GeoMapItem::setCrossfade3D ( bool crossfade3D)

Definition at line 140 of file GeoMapItem.cc.

References crossfade3D(), and crossfade3DChanged().

◆ setDelegate3D()

void GeoMapItem::setDelegate3D ( QQmlComponent * delegate3D)

Definition at line 119 of file GeoMapItem.cc.

References delegate3D(), and delegate3DChanged().

◆ setNode3DOpacity()

void GeoMapItem::setNode3DOpacity ( qreal node3DOpacity)

Definition at line 150 of file GeoMapItem.cc.

References node3DOpacity(), and node3DOpacityChanged().

◆ setScene()

◆ setSurfaceModel()

void GeoMapItem::setSurfaceModel ( SurfacePatchModel * surfaceModel)

◆ surfaceModel()

SurfacePatchModel * GeoMapItem::surfaceModel ( ) const
inline

Definition at line 81 of file GeoMapItem.h.

Referenced by setSurfaceModel().

◆ surfaceModelChanged

void GeoMapItem::surfaceModelChanged ( )
signal

Referenced by setSurfaceModel().


The documentation for this class was generated from the following files: