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)
 
GeoScenescene () const
 
void setScene (GeoScene *scene)
 
QGeoCoordinate anchorCoordinate () const
 
int pointCount () const
 
Q_INVOKABLE void setPath (const QVariantList &coordinates)
 Replace the whole path (QGeoCoordinate variants, TrajectoryPoints::list() format)
 
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 2
 

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) and a side flag (texcoord0.x, -1 left / +1 right); 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 41 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 61 of file FlightPathGeometry.h.

◆ anchorCoordinateChanged

void FlightPathGeometry::anchorCoordinateChanged ( )
signal

◆ appendPoint()

void FlightPathGeometry::appendPoint ( const QGeoCoordinate &  coordinate)

◆ clearPath()

void FlightPathGeometry::clearPath ( )

Definition at line 121 of file FlightPathGeometry.cc.

References anchorCoordinateChanged(), and pointCountChanged().

◆ pointCount()

int FlightPathGeometry::pointCount ( ) const
inline

Definition at line 63 of file FlightPathGeometry.h.

◆ pointCountChanged

void FlightPathGeometry::pointCountChanged ( )
signal

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

◆ scene()

GeoScene * FlightPathGeometry::scene ( ) const
inline

Definition at line 54 of file FlightPathGeometry.h.

Referenced by setScene().

◆ sceneChanged

void FlightPathGeometry::sceneChanged ( )
signal

Referenced by setScene().

◆ setPath()

void FlightPathGeometry::setPath ( const QVariantList &  coordinates)

Replace the whole path (QGeoCoordinate variants, TrajectoryPoints::list() format)

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 93 of file FlightPathGeometry.cc.

References anchorCoordinateChanged(), and kFloatsPerVertex.

Member Data Documentation

◆ kFloatsPerVertex

constexpr int FlightPathGeometry::kFloatsPerVertex = 8
staticconstexpr

position 3, tangent 3, side flag 2

Definition at line 52 of file FlightPathGeometry.h.

Referenced by appendPoint(), and updateLastPoint().


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