3#include <QtCore/QObject>
4#include <QtCore/QVariantList>
5#include <QtPositioning/QGeoCoordinate>
31 Q_INVOKABLE
void clear(
void);
32 Q_INVOKABLE
void appendVertex(
const QGeoCoordinate& coordinate);
34 Q_INVOKABLE
void appendVertices(
const QList<QGeoCoordinate>& coordinates);
39 Q_INVOKABLE
void adjustVertex(
int vertexIndex,
const QGeoCoordinate coordinate);
79 int count (
void)
const {
return _polylinePath.count(); }
80 bool dirty (
void)
const {
return _dirty; }
83 QVariantList
path (
void)
const {
return _polylinePath; }
85 bool empty (
void)
const {
return _polylineModel.
count() == 0; }
112 void _polylineModelCountChanged(
int count);
113 void _polylineModelDirtyChanged(
bool dirty);
117 QGeoCoordinate _coordFromPointF (
const QPointF& point)
const;
118 QPointF _pointFFromCoord (
const QGeoCoordinate& coordinate)
const;
120 QVariantList _polylinePath;
122 bool _deferredPathChanged =
false;
125 bool _traceMode =
false;
126 int _selectedVertexIndex = -1;
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)
bool loadKMLOrSHPFile(const QString &file)
void splitSegment(int vertexIndex)
Splits the line segment comprised of vertexIndex -> vertexIndex + 1.
void removeVertex(int vertexIndex)
void interactiveChanged(bool interactive)
QmlObjectListModel & pathModel(void)
void traceModeChanged(bool traceMode)
void adjustVertex(int vertexIndex, const QGeoCoordinate coordinate)
void setTraceMode(bool traceMode)
void isEmptyChanged(void)
int count READ count NOTIFY countChanged(QVariantList path READ path NOTIFY pathChanged) 1(QmlObjectListModel *pathModel READ qmlPathModel CONSTANT) 1(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) 1(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) 1(bool isValid READ isValid NOTIFY isValidChanged) 1(bool empty READ empty NOTIFY isEmptyChanged) 1(bool traceMode READ traceMode WRITE setTraceMode NOTIFY traceModeChanged) 1(int selectedVertex READ selectedVertex WRITE selectVertex NOTIFY selectedVertexChanged) 1 void clear(void)
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
void appendVertex(const QGeoCoordinate &coordinate)
~QGCMapPolyline() override
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)
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)
double length(void) const
Returns the length of the polyline in meters.
void countChanged(int count)
bool traceMode(void) const
void selectedVertexChanged(int index)
void setInteractive(bool interactive)
int count() const override final