|
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 | dragPathChanged (void) |
| void | dirtyChanged (bool dirty) |
| void | cleared (void) |
| void | interactiveChanged (bool interactive) |
| void | vertexDragChanged (bool vertexDrag) |
| 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) |
| Q_INVOKABLE void | clear (void) |
| Q_INVOKABLE void | appendVertex (const QGeoCoordinate &coordinate) |
| Q_INVOKABLE void | removeVertex (int vertexIndex) |
| Q_INVOKABLE void | appendVertices (const QList< QGeoCoordinate > &coordinates) |
| Q_INVOKABLE void | adjustVertex (int vertexIndex, const QGeoCoordinate coordinate) |
| Q_INVOKABLE void | splitSegment (int vertexIndex) |
| Splits the line segment comprised of vertexIndex -> vertexIndex + 1. | |
| QList< QGeoCoordinate > | offsetPolyline (double distance) |
| Q_INVOKABLE bool | loadKMLOrSHPFile (const QString &file) |
| Q_INVOKABLE void | beginReset (void) |
| Q_INVOKABLE void | endReset (void) |
| QList< QGeoCoordinate > | coordinateList (void) const |
| Returns the path in a list of QGeoCoordinate's format. | |
| Q_INVOKABLE 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 |
| bool | vertexDrag (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 | setVertexDrag (bool vertexDrag) |
| 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 16 of file QGCMapPolyline.cc.
| QGCMapPolyline::QGCMapPolyline | ( | const QGCMapPolyline & | other, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 24 of file QGCMapPolyline.cc.
|
override |
Definition at line 34 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 77 of file QGCMapPolyline.cc.
References dragPathChanged(), pathChanged(), setDirty(), and QmlObjectListModel::value().
| void QGCMapPolyline::appendVertex | ( | const QGeoCoordinate & | coordinate | ) |
Definition at line 235 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), and pathChanged().
Referenced by operator=(), and splitSegment().
| void QGCMapPolyline::appendVertices | ( | const QList< QGeoCoordinate > & | coordinates | ) |
Definition at line 424 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), beginReset(), endReset(), and pathChanged().
Referenced by loadKMLOrSHPFile().
| void QGCMapPolyline::beginReset | ( | void | ) |
Definition at line 440 of file QGCMapPolyline.cc.
References ObjectItemModelBase::beginResetModel().
Referenced by appendVertices(), loadKMLOrSHPFile(), setPath(), and setPath().
| void QGCMapPolyline::clear | ( | void | ) |
Definition at line 65 of file QGCMapPolyline.cc.
References QmlObjectListModel::clearAndDeleteContents(), cleared(), pathChanged(), and setDirty().
Referenced by loadFromJson(), loadKMLOrSHPFile(), and operator=().
|
signal |
Referenced by clear().
| QList< QGeoCoordinate > QGCMapPolyline::coordinateList | ( | void | ) | const |
Returns the path in a list of QGeoCoordinate's format.
Definition at line 201 of file QGCMapPolyline.cc.
Referenced by CorridorScanComplexItem::setCoordinate().
|
inline |
Definition at line 81 of file QGCMapPolyline.h.
Referenced by nedPolyline(), offsetPolyline(), selectVertex(), CorridorScanComplexItem::setCoordinate(), and CorridorScanComplexItem::specifiesCoordinate().
|
signal |
|
inline |
Definition at line 82 of file QGCMapPolyline.h.
Referenced by setDirty().
|
signal |
Referenced by CorridorScanComplexItem::CorridorScanComplexItem(), and setDirty().
|
signal |
Referenced by adjustVertex().
|
inline |
Definition at line 88 of file QGCMapPolyline.h.
References QmlObjectListModel::count().
| void QGCMapPolyline::endReset | ( | void | ) |
Definition at line 445 of file QGCMapPolyline.cc.
References ObjectItemModelBase::endResetModel().
Referenced by appendVertices(), loadKMLOrSHPFile(), setPath(), and setPath().
|
inline |
Definition at line 84 of file QGCMapPolyline.h.
Referenced by setInteractive().
|
signal |
Referenced by setInteractive().
|
signal |
|
inline |
Definition at line 87 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 411 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 174 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), clear(), errorString, jsonPolylineKey, GeoJsonHelper::loadGeoCoordinateArray(), pathChanged(), setDirty(), and JsonParsing::validateRequiredKeys().
| bool QGCMapPolyline::loadKMLOrSHPFile | ( | const QString & | file | ) |
Loads a polyline from a KML/SHP file
Definition at line 376 of file QGCMapPolyline.cc.
References appendVertices(), beginReset(), clear(), endReset(), errorString, ShapeFileHelper::loadPolylinesFromFile(), and QGC::showAppMessage().
| QList< QPointF > QGCMapPolyline::nedPolyline | ( | void | ) |
Convert polyline to NED and return (D is ignored)
Definition at line 296 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 319 of file QGCMapPolyline.cc.
References QGCGeo::convertNedToGeo(), count(), nedPolyline(), and vertexCoordinate().
| const QGCMapPolyline & QGCMapPolyline::operator= | ( | const QGCMapPolyline & | other | ) |
Definition at line 39 of file QGCMapPolyline.cc.
References appendVertex(), clear(), path(), and setDirty().
|
inline |
Definition at line 86 of file QGCMapPolyline.h.
Referenced by operator=(), setPath(), and setPath().
|
signal |
|
inline |
Definition at line 93 of file QGCMapPolyline.h.
|
inline |
Definition at line 92 of file QGCMapPolyline.h.
| void QGCMapPolyline::removeVertex | ( | int | vertexIndex | ) |
Definition at line 242 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 165 of file QGCMapPolyline.cc.
References jsonPolylineKey, GeoJsonHelper::saveGeoCoordinateArray(), and setDirty().
|
inline |
Definition at line 90 of file QGCMapPolyline.h.
|
signal |
Referenced by selectVertex().
| void QGCMapPolyline::selectVertex | ( | int | index | ) |
Definition at line 458 of file QGCMapPolyline.cc.
References count(), and selectedVertexChanged().
Referenced by removeVertex().
| void QGCMapPolyline::setDirty | ( | bool | dirty | ) |
Definition at line 99 of file QGCMapPolyline.cc.
References dirty(), dirtyChanged(), and QmlObjectListModel::setDirty().
Referenced by adjustVertex(), clear(), loadFromJson(), operator=(), saveToJson(), setPath(), and setPath().
| void QGCMapPolyline::setInteractive | ( | bool | interactive | ) |
Definition at line 266 of file QGCMapPolyline.cc.
References interactive(), and interactiveChanged().
| void QGCMapPolyline::setPath | ( | const QList< QGeoCoordinate > & | path | ) |
Definition at line 134 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 150 of file QGCMapPolyline.cc.
References QmlObjectListModel::append(), beginReset(), QmlObjectListModel::clearAndDeleteContents(), endReset(), path(), and setDirty().
| void QGCMapPolyline::setTraceMode | ( | bool | traceMode | ) |
Definition at line 450 of file QGCMapPolyline.cc.
References traceMode(), and traceModeChanged().
| void QGCMapPolyline::setVertexDrag | ( | bool | vertexDrag | ) |
Definition at line 274 of file QGCMapPolyline.cc.
References pathChanged(), vertexDrag(), and vertexDragChanged().
| void QGCMapPolyline::splitSegment | ( | int | vertexIndex | ) |
Splits the line segment comprised of vertexIndex -> vertexIndex + 1.
Definition at line 212 of file QGCMapPolyline.cc.
References appendVertex(), QmlObjectListModel::insert(), and pathChanged().
|
inline |
Definition at line 89 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 286 of file QGCMapPolyline.cc.
Referenced by nedPolyline(), and offsetPolyline().
|
inline |
Definition at line 85 of file QGCMapPolyline.h.
Referenced by setVertexDrag().
|
signal |
Referenced by setVertexDrag().
|
staticconstexpr |
Definition at line 102 of file QGCMapPolyline.h.
Referenced by loadFromJson(), and saveToJson().