3#include <QtCore/QObject>
4#include <QtCore/QVariantList>
5#include <QtPositioning/QGeoCoordinate>
33 Q_INVOKABLE
void clear(
void);
34 Q_INVOKABLE
void appendVertex(
const QGeoCoordinate& coordinate);
36 Q_INVOKABLE
void appendVertices(
const QList<QGeoCoordinate>& coordinates);
41 Q_INVOKABLE
void adjustVertex(
int vertexIndex,
const QGeoCoordinate coordinate);
72 bool loadFromJson(
const QJsonObject& json,
bool required, QString& errorString);
81 int count (
void)
const {
return _polylinePath.count(); }
82 bool dirty (
void)
const {
return _dirty; }
86 QVariantList
path (
void)
const {
return _polylinePath; }
87 bool isValid (
void)
const {
return _polylineModel.count() >= 2; }
88 bool empty (
void)
const {
return _polylineModel.count() == 0; }
118 void _polylineModelCountChanged(
int count);
119 void _polylineModelDirtyChanged(
bool dirty);
123 QGeoCoordinate _coordFromPointF (
const QPointF& point)
const;
124 QPointF _pointFFromCoord (
const QGeoCoordinate& coordinate)
const;
126 QVariantList _polylinePath;
128 bool _deferredPathChanged =
false;
131 bool _vertexDrag =
false;
132 bool _traceMode =
false;
133 int _selectedVertexIndex = -1;
Q_INVOKABLE void beginReset(void)
QList< QGeoCoordinate > offsetPolyline(double distance)
void dirtyChanged(bool dirty)
static constexpr const char * jsonPolylineKey
QList< QPointF > nedPolyline(void)
Convert polyline to NED and return (D is ignored).
Q_INVOKABLE void clear(void)
Q_INVOKABLE bool loadKMLOrSHPFile(const QString &file)
Q_INVOKABLE void splitSegment(int vertexIndex)
Splits the line segment comprised of vertexIndex -> vertexIndex + 1.
Q_INVOKABLE void removeVertex(int vertexIndex)
void interactiveChanged(bool interactive)
QmlObjectListModel & pathModel(void)
void traceModeChanged(bool traceMode)
Q_INVOKABLE void adjustVertex(int vertexIndex, const QGeoCoordinate coordinate)
void dragPathChanged(void)
void setTraceMode(bool traceMode)
void isEmptyChanged(void)
Q_INVOKABLE QGeoCoordinate vertexCoordinate(int vertex) const
Returns the QGeoCoordinate for the vertex specified.
void selectVertex(int index)
void setPath(const QList< QGeoCoordinate > &path)
void setDirty(bool dirty)
bool interactive(void) const
Q_INVOKABLE void appendVertex(const QGeoCoordinate &coordinate)
~QGCMapPolyline() override
void vertexDragChanged(bool vertexDrag)
bool vertexDrag(void) const
void saveToJson(QJsonObject &json)
QmlObjectListModel * qmlPathModel(void)
QList< QGeoCoordinate > coordinateList(void) const
Returns the path in a list of QGeoCoordinate's format.
const QGCMapPolyline & operator=(const QGCMapPolyline &other)
Q_INVOKABLE void endReset(void)
Q_INVOKABLE void appendVertices(const QList< QGeoCoordinate > &coordinates)
int selectedVertex() const
QVariantList path(void) const
void isValidChanged(void)
bool loadFromJson(const QJsonObject &json, bool required, QString &errorString)
QGCMapPolyline(QObject *parent=nullptr)
double length(void) const
Returns the length of the polyline in meters.
void countChanged(int count)
void setVertexDrag(bool vertexDrag)
bool traceMode(void) const
void selectedVertexChanged(int index)
void setInteractive(bool interactive)