|
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, 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 | |
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.
|
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 62 of file FlightPathGeometry.h.
|
signal |
Referenced by appendPoint(), clearPath(), setPath(), and updateLastPoint().
| void FlightPathGeometry::appendPoint | ( | const QGeoCoordinate & | coordinate | ) |
Definition at line 68 of file FlightPathGeometry.cc.
References anchorCoordinateChanged(), kFloatsPerVertex, and pointCountChanged().
| void FlightPathGeometry::clearPath | ( | ) |
Definition at line 125 of file FlightPathGeometry.cc.
References anchorCoordinateChanged(), and pointCountChanged().
|
inline |
Definition at line 64 of file FlightPathGeometry.h.
|
signal |
Referenced by appendPoint(), clearPath(), and setPath().
|
inline |
Definition at line 55 of file FlightPathGeometry.h.
Referenced by setScene().
|
signal |
Referenced by setScene().
| 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().
| 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 97 of file FlightPathGeometry.cc.
References anchorCoordinateChanged(), and kFloatsPerVertex.
|
staticconstexpr |
position 3, tangent 3, side flag, highlight flag
Definition at line 53 of file FlightPathGeometry.h.
Referenced by appendPoint(), and updateLastPoint().