QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GeoMapProjectedPath.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 *
5 * QGroundControl is licensed according to the terms in the file
6 * COPYING.md in the root of the source code directory.
7 *
8 ****************************************************************************/
9
10#pragma once
11
12#include <QtCore/QVariantList>
13#include <QtPositioning/QGeoCoordinate>
14#include <QtQmlIntegration/QtQmlIntegration>
15
16#include "GeoMapItem.h"
17
18class GeoScene;
19class GeoMapCamera;
21
22Q_MOC_INCLUDE("GeoScene.h")
23Q_MOC_INCLUDE("SurfacePatchModel.h")
24
34class GeoMapProjectedPath : public QObject
35{
36 Q_OBJECT
37 QML_ELEMENT
38 Q_PROPERTY(QVariantList coordinates READ coordinates WRITE setCoordinates NOTIFY coordinatesChanged)
39 Q_PROPERTY(GeoScene* scene READ scene WRITE setScene NOTIFY sceneChanged)
40 Q_PROPERTY(SurfacePatchModel* surfaceModel READ surfaceModel WRITE setSurfaceModel NOTIFY surfaceModelChanged)
41 Q_PROPERTY(GeoMapItem::AltitudeMode altitudeMode READ altitudeMode WRITE setAltitudeMode NOTIFY altitudeModeChanged)
42 Q_PROPERTY(QVariantList screenPoints READ screenPoints NOTIFY screenPointsChanged)
43 Q_PROPERTY(bool projected READ projected NOTIFY projectedChanged)
44
45public:
46 explicit GeoMapProjectedPath(QObject* parent = nullptr);
47
48 QVariantList coordinates() const { return _coordinates; }
49
50 void setCoordinates(const QVariantList& coordinates);
51
52 GeoScene* scene() const { return _scene; }
53
54 void setScene(GeoScene* scene);
55
56 SurfacePatchModel* surfaceModel() const { return _surfaceModel; }
57
58 void setSurfaceModel(SurfacePatchModel* surfaceModel);
59
60 GeoMapItem::AltitudeMode altitudeMode() const { return _altitudeMode; }
61
62 void setAltitudeMode(GeoMapItem::AltitudeMode mode);
63
64 QVariantList screenPoints() const { return _screenPoints; }
65
68 bool projected() const { return _projected; }
69
73 Q_INVOKABLE static QVariantList circleCoordinates(const QGeoCoordinate& center, double radiusMeters,
74 int segments = 32);
75
76signals:
83
84private slots:
85 void _rebuild();
86 void _terrainHeightsChanged();
87
88private:
89 void _connectCamera();
90
91 QVariantList _coordinates;
92 GeoScene* _scene = nullptr;
93 SurfacePatchModel* _surfaceModel = nullptr;
94 GeoMapCamera* _connectedCamera = nullptr;
96 QVariantList _screenPoints;
97 bool _projected = false;
98};
AltitudeMode
How the coordinate's vertical position is resolved.
Definition GeoMapItem.h:60
@ ClampToGround
sit on the rendered terrain surface (default)
QVariantList screenPoints() const
GeoMapItem::AltitudeMode altitudeMode() const
GeoScene * scene() const
QVariantList coordinates() const
SurfacePatchModel * surfaceModel() const
void setScene(GeoScene *scene)
GeoScene * scene() const