|
|
|
@ -26,11 +26,12 @@ class QGCMapPolygon : public QObject
@@ -26,11 +26,12 @@ class QGCMapPolygon : public QObject
|
|
|
|
|
public: |
|
|
|
|
QGCMapPolygon(QObject* newCoordParent, QObject* parent = NULL); |
|
|
|
|
|
|
|
|
|
Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
|
|
|
Q_PROPERTY(QVariantList path READ path NOTIFY pathChanged) |
|
|
|
|
Q_PROPERTY(QmlObjectListModel* pathModel READ qmlPathModel CONSTANT) |
|
|
|
|
Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) |
|
|
|
|
Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter NOTIFY centerChanged) |
|
|
|
|
Q_PROPERTY(int count READ count NOTIFY countChanged) |
|
|
|
|
Q_PROPERTY(QVariantList path READ path NOTIFY pathChanged) |
|
|
|
|
Q_PROPERTY(QmlObjectListModel* pathModel READ qmlPathModel CONSTANT) |
|
|
|
|
Q_PROPERTY(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) |
|
|
|
|
Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter NOTIFY centerChanged) |
|
|
|
|
Q_PROPERTY(bool centerDrag READ centerDrag WRITE setCenterDrag NOTIFY centerDragChanged) |
|
|
|
|
|
|
|
|
|
Q_INVOKABLE void clear(void); |
|
|
|
|
Q_INVOKABLE void appendVertex(const QGeoCoordinate& coordinate); |
|
|
|
@ -63,28 +64,30 @@ public:
@@ -63,28 +64,30 @@ public:
|
|
|
|
|
|
|
|
|
|
// Property methods
|
|
|
|
|
|
|
|
|
|
int count (void) const { return _polygonPath.count(); } |
|
|
|
|
bool dirty (void) const { return _dirty; } |
|
|
|
|
void setDirty(bool dirty); |
|
|
|
|
QGeoCoordinate center (void) const { return _center; } |
|
|
|
|
|
|
|
|
|
int count (void) const { return _polygonPath.count(); } |
|
|
|
|
bool dirty (void) const { return _dirty; } |
|
|
|
|
void setDirty (bool dirty); |
|
|
|
|
QGeoCoordinate center (void) const { return _center; } |
|
|
|
|
bool centerDrag (void) const { return _centerDrag; } |
|
|
|
|
|
|
|
|
|
QVariantList path (void) const { return _polygonPath; } |
|
|
|
|
QmlObjectListModel* qmlPathModel(void) { return &_polygonModel; } |
|
|
|
|
QmlObjectListModel& pathModel (void) { return _polygonModel; } |
|
|
|
|
|
|
|
|
|
void setPath(const QList<QGeoCoordinate>& path); |
|
|
|
|
void setPath(const QVariantList& path); |
|
|
|
|
void setCenter(QGeoCoordinate newCenter); |
|
|
|
|
void setPath (const QList<QGeoCoordinate>& path); |
|
|
|
|
void setPath (const QVariantList& path); |
|
|
|
|
void setCenter (QGeoCoordinate newCenter); |
|
|
|
|
void setCenterDrag (bool centerDrag); |
|
|
|
|
|
|
|
|
|
static const char* jsonPolygonKey; |
|
|
|
|
|
|
|
|
|
signals: |
|
|
|
|
void countChanged (int count); |
|
|
|
|
void pathChanged (void); |
|
|
|
|
void dirtyChanged (bool dirty); |
|
|
|
|
void cleared (void); |
|
|
|
|
void centerChanged (QGeoCoordinate center); |
|
|
|
|
void countChanged (int count); |
|
|
|
|
void pathChanged (void); |
|
|
|
|
void dirtyChanged (bool dirty); |
|
|
|
|
void cleared (void); |
|
|
|
|
void centerChanged (QGeoCoordinate center); |
|
|
|
|
void centerDragChanged (bool centerDrag); |
|
|
|
|
|
|
|
|
|
private slots: |
|
|
|
|
void _polygonModelCountChanged(int count); |
|
|
|
@ -101,6 +104,7 @@ private:
@@ -101,6 +104,7 @@ private:
|
|
|
|
|
QmlObjectListModel _polygonModel; |
|
|
|
|
bool _dirty; |
|
|
|
|
QGeoCoordinate _center; |
|
|
|
|
bool _centerDrag; |
|
|
|
|
bool _ignoreCenterUpdates; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|