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

#include <FlightPathGeometry.h>

+ Inheritance diagram for FlightPathGeometry:
+ Collaboration diagram for FlightPathGeometry:

Signals

void sceneChanged ()
 
void anchorCoordinateChanged ()
 
void pointCountChanged ()
 

Public Member Functions

 FlightPathGeometry (QQuick3DObject *parent=nullptr)
 
GeoScene * scene () const
 
void setScene (GeoScene *scene)
 
QGeoCoordinate anchorCoordinate () const
 
int pointCount () const
 
Q_INVOKABLE void setPath (const QVariantList &coordinates, const QVariantList &highlights=QVariantList())
 
Q_INVOKABLE void appendPoint (const QGeoCoordinate &coordinate)
 
Q_INVOKABLE void updateLastPoint (const QGeoCoordinate &coordinate)
 Replace the last point (TrajectoryPoints emits this for colinear motion)
 
Q_INVOKABLE void clearPath ()
 

Static Public Attributes

static constexpr int kFloatsPerVertex = 8
 position 3, tangent 3, side flag, highlight flag
 

Detailed Description

Flight-path trail ribbon for the GeoMap 3D scene: a triangle strip along the vehicle's trajectory, depth-tested against terrain (hills hide it). Each trail point yields two centerline vertices carrying the path's unit 3D tangent (normal slot), a side flag (texcoord0.x, -1 left / +1 right) and a highlight flag (texcoord0.y, 0 or 1, for the fragment shader's highlight color); the ribbon has zero width until a vertex shader expands each vertex perpendicular to both the tangent and the view direction (billboarding), keeping the width constant in screen pixels for any segment orientation — including straight vertical climbs.

Positions are scene-unit offsets relative to anchorCoordinate (the first path point), so the buffer is immune to scene-origin re-anchors and to any constant altitude bias applied at the anchor. z offsets are pre-scaled by the scene's verticalScale but NOT terrainScale: parent the model under a node whose z-scale tracks GeoScene::terrainScale.

appendPoint/updateLastPoint update the vertex buffer incrementally (only the last two vertex pairs change); setPath and scene re-anchors rebuild it.

Definition at line 42 of file FlightPathGeometry.h.

Constructor & Destructor Documentation

◆ FlightPathGeometry()

FlightPathGeometry::FlightPathGeometry ( QQuick3DObject *  parent = nullptr)
explicit

Definition at line 23 of file FlightPathGeometry.cc.

Member Function Documentation

◆ anchorCoordinate()

QGeoCoordinate FlightPathGeometry::anchorCoordinate ( ) const
inline

First path point (invalid while the path is empty). Place the ribbon's node at this coordinate; altitude offsets in the buffer are relative to its altitude.

Definition at line 62 of file FlightPathGeometry.h.

◆ anchorCoordinateChanged

void FlightPathGeometry::anchorCoordinateChanged ( )
signal

◆ appendPoint()

void FlightPathGeometry::appendPoint ( const QGeoCoordinate &  coordinate)

◆ clearPath()

void FlightPathGeometry::clearPath ( )

Definition at line 125 of file FlightPathGeometry.cc.

References anchorCoordinateChanged(), and pointCountChanged().

◆ pointCount()

int FlightPathGeometry::pointCount ( ) const
inline

Definition at line 64 of file FlightPathGeometry.h.

◆ pointCountChanged

void FlightPathGeometry::pointCountChanged ( )
signal

Referenced by appendPoint(), clearPath(), and setPath().

◆ scene()

GeoScene * FlightPathGeometry::scene ( ) const
inline

Definition at line 55 of file FlightPathGeometry.h.

Referenced by setScene().

◆ sceneChanged

void FlightPathGeometry::sceneChanged ( )
signal

Referenced by setScene().

◆ setPath()

void FlightPathGeometry::setPath ( const QVariantList &  coordinates,
const QVariantList &  highlights = QVariantList() 
)

Replace the whole path (QGeoCoordinate variants, TrajectoryPoints::list() format). highlights[i] (bool) highlights point i; missing entries are false. A segment between differently highlighted points blends along its length.

Definition at line 50 of file FlightPathGeometry.cc.

References anchorCoordinateChanged(), and pointCountChanged().

◆ setScene()

void FlightPathGeometry::setScene ( GeoScene *  scene)

Definition at line 28 of file FlightPathGeometry.cc.

References scene(), sceneChanged(), and GeoScene::sceneOriginChanged().

◆ updateLastPoint()

void FlightPathGeometry::updateLastPoint ( const QGeoCoordinate &  coordinate)

Replace the last point (TrajectoryPoints emits this for colinear motion)

Definition at line 97 of file FlightPathGeometry.cc.

References anchorCoordinateChanged(), and kFloatsPerVertex.

Member Data Documentation

◆ kFloatsPerVertex

constexpr int FlightPathGeometry::kFloatsPerVertex = 8
staticconstexpr

position 3, tangent 3, side flag, highlight flag

Definition at line 53 of file FlightPathGeometry.h.

Referenced by appendPoint(), and updateLastPoint().


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