|
QGroundControl
Ground Control Station for MAVLink Drones
|
#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) |
| 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 | |
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.
|
explicit |
Definition at line 23 of file FlightPathGeometry.cc.
|
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.
|
signal |
Referenced by appendPoint(), clearPath(), setPath(), and updateLastPoint().
| void FlightPathGeometry::appendPoint | ( | const QGeoCoordinate & | coordinate | ) |
Definition at line 65 of file FlightPathGeometry.cc.
References anchorCoordinateChanged(), kFloatsPerVertex, and pointCountChanged().
| void FlightPathGeometry::clearPath | ( | ) |
Definition at line 121 of file FlightPathGeometry.cc.
References anchorCoordinateChanged(), and pointCountChanged().
|
inline |
Definition at line 63 of file FlightPathGeometry.h.
|
signal |
Referenced by appendPoint(), clearPath(), and setPath().
|
inline |
Definition at line 54 of file FlightPathGeometry.h.
Referenced by setScene().
|
signal |
Referenced by setScene().
| 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().
| void FlightPathGeometry::setScene | ( | GeoScene * | scene | ) |
Definition at line 28 of file FlightPathGeometry.cc.
References scene(), sceneChanged(), and GeoScene::sceneOriginChanged().
| 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.
|
staticconstexpr |
position 3, tangent 3, side flag 2
Definition at line 52 of file FlightPathGeometry.h.
Referenced by appendPoint(), and updateLastPoint().