WimaServicePolygon.h 1.34 KB
Newer Older
1
#pragma once
2

3
#include <QObject>
4 5 6 7 8 9
#include "WimaPolygon.h"

class WimaServicePolygon : public WimaPolygon
{
    Q_OBJECT
public:
10 11 12
    WimaServicePolygon(QObject* parent = nullptr);
    WimaServicePolygon(QGCMapPolygon* other, QObject* parent = nullptr);

13 14
    Q_PROPERTY(QGeoCoordinate* takeOffPosition           READ takeOffPosition                    WRITE setTakeOffPosition            NOTIFY takeOffPositionChanged)
    Q_PROPERTY(QGeoCoordinate* landPosition              READ landPosition                       WRITE setLandPosition               NOTIFY landPositionChanged)
15 16

    // Overrides from WimaPolygon
17
    QString         mapVisualQML    (void) const { return "WimaServicePolygonMapVisual.qml";}
18 19 20
    QString         editorQML       (void) const { return "WimaServicePolygonEditor.qml";}

    // Property acessors
21 22
    QGeoCoordinate*          takeOffPosition             (void)  { return &_takeOffPosition;}
    QGeoCoordinate*          landPosition                (void)  { return &_landPosition;}
23 24

    // Property setters
25 26
    void setTakeOffPosition             (QGeoCoordinate* coordinate);
    void setLandPosition                (QGeoCoordinate* coordinate);
27 28

signals:
29 30
    void takeOffPositionChanged         (void);
    void landPositionChanged            (void);
31 32 33 34 35
private:
    QGeoCoordinate      _takeOffPosition;
    QGeoCoordinate      _landPosition;
};