|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <QGCMapPolyline.h>
Inheritance diagram for QGCMapPolyline:
Collaboration diagram for QGCMapPolyline:Signals | |
| void | countChanged (int count) |
| void | pathChanged (void) |
| void | dirtyChanged (bool dirty) |
| void | cleared (void) |
| void | interactiveChanged (bool interactive) |
| void | isValidChanged (void) |
| void | isEmptyChanged (void) |
| void | traceModeChanged (bool traceMode) |
| void | selectedVertexChanged (int index) |
Public Member Functions | |
| QGCMapPolyline (QObject *parent=nullptr) | |
| QGCMapPolyline (const QGCMapPolyline &other, QObject *parent=nullptr) | |
| ~QGCMapPolyline () override | |
| const QGCMapPolyline & | operator= (const QGCMapPolyline &other) |
| 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) |
| void | appendVertex (const QGeoCoordinate &coordinate) |
| void | removeVertex (int vertexIndex) |
| void | appendVertices (const QList< QGeoCoordinate > &coordinates) |
| void | adjustVertex (int vertexIndex, const QGeoCoordinate coordinate) |
| void | splitSegment (int vertexIndex) |
| Splits the line segment comprised of vertexIndex -> vertexIndex + 1. | |
| QList< QGeoCoordinate > | offsetPolyline (double distance) |
| bool | loadKMLOrSHPFile (const QString &file) |
| void | beginReset (void) |
| void | endReset (void) |
| QList< QGeoCoordinate > | coordinateList (void) const |
| Returns the path in a list of QGeoCoordinate's format. | |
| QGeoCoordinate | vertexCoordinate (int vertex) const |
| Returns the QGeoCoordinate for the vertex specified. | |
| void | saveToJson (QJsonObject &json) |
| bool | loadFromJson (const QJsonObject &json, bool required, QString &errorString) |
| QList< QPointF > | nedPolyline (void) |
| Convert polyline to NED and return (D is ignored) | |
| double | length (void) const |
| Returns the length of the polyline in meters. | |
| int | count (void) const |
| bool | dirty (void) const |
| void | setDirty (bool dirty) |
| bool | interactive (void) const |
| QVariantList | path (void) const |
| bool | isValid (void) const |
| bool | empty (void) const |
| bool | traceMode (void) const |
| int | selectedVertex () const |
| QmlObjectListModel * | qmlPathModel (void) |
| QmlObjectListModel & | pathModel (void) |
| void | setPath (const QList< QGeoCoordinate > &path) |
| void | setPath (const QVariantList &path) |
| void | setInteractive (bool interactive) |
| void | setTraceMode (bool traceMode) |
| void | selectVertex (int index) |
Static Public Attributes | |
| static constexpr const char * | jsonPolylineKey = "polyline" |
Definition at line 9 of file QGCMapPolyline.h.
| QGCMapPolyline::QGCMapPolyline | ( | QObject * | parent = nullptr | ) |
Definition at line 15 of file QGCMapPolyline.cc.
| QGCMapPolyline::QGCMapPolyline | ( | const QGCMapPolyline & | other, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 23 of file QGCMapPolyline.cc.
|
override |
Definition at line 33 of file QGCMapPolyline.cc.
References pathChanged(), and qgcApp.
| void QGCMapPolyline::adjustVertex | ( | int | vertexIndex, |
| const QGeoCoordinate | coordinate | ||
| ) |
Adjust the value for the specified coordinate
| vertexIndex | Polygon point index to modify (0-based) |
| coordinate | New coordinate for point |
Definition at line 76 of file QGCMapPolyline.cc.
References pathChanged(), setDirty(), and QmlObjectListModel::value().
| void QGCMapPolyline::appendVertex | ( | const QGeoCoordinate & | coordinate | ) |
Definition at line 226 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), and pathChanged().
Referenced by operator=(), and splitSegment().
| void QGCMapPolyline::appendVertices | ( | const QList< QGeoCoordinate > & | coordinates | ) |
Definition at line 403 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), beginReset(), endReset(), and pathChanged().
Referenced by loadKMLOrSHPFile().
| void QGCMapPolyline::beginReset | ( | void | ) |
Definition at line 419 of file QGCMapPolyline.cc.
References ObjectItemModelBase::beginResetModel().
Referenced by appendVertices(), loadKMLOrSHPFile(), setPath(), and setPath().
|
signal |
| QList< QGeoCoordinate > QGCMapPolyline::coordinateList | ( | void | ) | const |
Returns the path in a list of QGeoCoordinate's format.
Definition at line 192 of file QGCMapPolyline.cc.
Referenced by CorridorScanComplexItem::setCoordinate().
|
inline |
Definition at line 79 of file QGCMapPolyline.h.
Referenced by nedPolyline(), offsetPolyline(), selectVertex(), CorridorScanComplexItem::setCoordinate(), and CorridorScanComplexItem::specifiesCoordinate().
|
signal |
| int count READ count NOTIFY QGCMapPolyline::countChanged | ( | QVariantList path READ path NOTIFY | pathChanged | ) |
|
inline |
Definition at line 80 of file QGCMapPolyline.h.
Referenced by setDirty().
|
signal |
Referenced by CorridorScanComplexItem::CorridorScanComplexItem(), and setDirty().
|
inline |
Definition at line 85 of file QGCMapPolyline.h.
References QmlObjectListModel::count().
| void QGCMapPolyline::endReset | ( | void | ) |
Definition at line 424 of file QGCMapPolyline.cc.
References ObjectItemModelBase::endResetModel().
Referenced by appendVertices(), loadKMLOrSHPFile(), setPath(), and setPath().
|
inline |
Definition at line 82 of file QGCMapPolyline.h.
Referenced by setInteractive().
|
signal |
Referenced by setInteractive().
|
signal |
|
inline |
Definition at line 84 of file QGCMapPolyline.h.
References QmlObjectListModel::count().
|
signal |
Referenced by CorridorScanComplexItem::CorridorScanComplexItem().
| double QGCMapPolyline::length | ( | void | ) | const |
Returns the length of the polyline in meters.
Definition at line 390 of file QGCMapPolyline.cc.
References length().
Referenced by length().
| bool QGCMapPolyline::loadFromJson | ( | const QJsonObject & | json, |
| bool | required, | ||
| QString & | errorString | ||
| ) |
Load a polyline from json
| json | Json object to load from |
| required | true: no polygon in object will generate error |
| errorString | Error string if return is false |
Definition at line 165 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), errorString, jsonPolylineKey, JsonHelper::loadGeoCoordinateArray(), pathChanged(), setDirty(), and JsonParsing::validateRequiredKeys().
| bool QGCMapPolyline::loadKMLOrSHPFile | ( | const QString & | file | ) |
Loads a polyline from a KML/SHP file
Definition at line 355 of file QGCMapPolyline.cc.
References appendVertices(), beginReset(), endReset(), errorString, and qgcApp.
| QList< QPointF > QGCMapPolyline::nedPolyline | ( | void | ) |
Convert polyline to NED and return (D is ignored)
Definition at line 275 of file QGCMapPolyline.cc.
References QGCGeo::convertGeoToNed(), count(), nedPolyline(), and vertexCoordinate().
Referenced by nedPolyline(), and offsetPolyline().
| QList< QGeoCoordinate > QGCMapPolyline::offsetPolyline | ( | double | distance | ) |
Offsets the current polyline edges by the specified distance in meters
Definition at line 298 of file QGCMapPolyline.cc.
References QGCGeo::convertNedToGeo(), count(), nedPolyline(), and vertexCoordinate().
| const QGCMapPolyline & QGCMapPolyline::operator= | ( | const QGCMapPolyline & | other | ) |
Definition at line 38 of file QGCMapPolyline.cc.
References appendVertex(), path(), and setDirty().
|
inline |
Definition at line 83 of file QGCMapPolyline.h.
Referenced by operator=(), setPath(), and setPath().
|
signal |
|
inline |
Definition at line 90 of file QGCMapPolyline.h.
|
inline |
Definition at line 89 of file QGCMapPolyline.h.
| void QGCMapPolyline::removeVertex | ( | int | vertexIndex | ) |
Definition at line 233 of file QGCMapPolyline.cc.
References pathChanged(), QmlObjectListModel::removeAt(), and selectVertex().
| void QGCMapPolyline::saveToJson | ( | QJsonObject & | json | ) |
Saves the polyline to the json object.
| json | Json object to save to |
Definition at line 156 of file QGCMapPolyline.cc.
References jsonPolylineKey, JsonHelper::saveGeoCoordinateArray(), and setDirty().
|
inline |
Definition at line 87 of file QGCMapPolyline.h.
|
signal |
Referenced by selectVertex().
| void QGCMapPolyline::selectVertex | ( | int | index | ) |
Definition at line 437 of file QGCMapPolyline.cc.
References count(), and selectedVertexChanged().
Referenced by removeVertex().
| void QGCMapPolyline::setDirty | ( | bool | dirty | ) |
Definition at line 90 of file QGCMapPolyline.cc.
References dirty(), dirtyChanged(), and QmlObjectListModel::setDirty().
Referenced by adjustVertex(), loadFromJson(), operator=(), saveToJson(), setPath(), and setPath().
| void QGCMapPolyline::setInteractive | ( | bool | interactive | ) |
Definition at line 257 of file QGCMapPolyline.cc.
References interactive(), and interactiveChanged().
| void QGCMapPolyline::setPath | ( | const QList< QGeoCoordinate > & | path | ) |
Definition at line 125 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), beginReset(), QmlObjectListModel::clearAndDeleteContents(), endReset(), path(), and setDirty().
Referenced by CorridorScanComplexItem::setCoordinate().
| void QGCMapPolyline::setPath | ( | const QVariantList & | path | ) |
Definition at line 141 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), beginReset(), QmlObjectListModel::clearAndDeleteContents(), endReset(), path(), and setDirty().
| void QGCMapPolyline::setTraceMode | ( | bool | traceMode | ) |
Definition at line 429 of file QGCMapPolyline.cc.
References traceMode(), and traceModeChanged().
| void QGCMapPolyline::splitSegment | ( | int | vertexIndex | ) |
Splits the line segment comprised of vertexIndex -> vertexIndex + 1.
Definition at line 203 of file QGCMapPolyline.cc.
References appendVertex(), QmlObjectListModel::insert(), and pathChanged().
|
inline |
Definition at line 86 of file QGCMapPolyline.h.
Referenced by setTraceMode().
|
signal |
Referenced by CorridorScanComplexItem::CorridorScanComplexItem(), and setTraceMode().
| QGeoCoordinate QGCMapPolyline::vertexCoordinate | ( | int | vertex | ) | const |
Returns the QGeoCoordinate for the vertex specified.
Definition at line 265 of file QGCMapPolyline.cc.
Referenced by nedPolyline(), and offsetPolyline().
|
staticconstexpr |
Definition at line 98 of file QGCMapPolyline.h.
Referenced by loadFromJson(), and saveToJson().