WimaServicePolygon.h 1.76 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#ifndef WIMASERVICEPOLYGON_H
#define WIMASERVICEPOLYGON_H

#include "QObject"
#include "WimaPolygon.h"

class WimaServicePolygon : public WimaPolygon
{
    Q_OBJECT
public:
    WimaServicePolygon(QObject* parent);
    Q_PROPERTY(QGeoCoordiante takeOffPosition           READ takeOffPosition                    WRITE setTakeOffPosition            NOTIFY takeOffPositionChanged)
    Q_PROPERTY(QGeoCoordinate landPosition              READ landPosition                       WRITE setLandPosition               NOTIFY landPositionChanged)
    Q_PROPERTY(Vehicle* vehicle                         READ vehicle                            WRITE setVehicle                    NOTIFY vehicleChanged)

    // Overrides from WimaPolygon
    QString         mapVisualQML    (void) const { return "WimaServicePolygonMapVisal.qml";}
    QString         editorQML       (void) const { return "WimaServicePolygonEditor.qml";}

    // Property acessors
    QGeoCoordinate          takeOffPosition             (void) const { return _takeOffPosition;}
    QGeoCoordinate          landPosition                (void) const { return _landPosition;}
    Vehicle*                vehicle                     (void) const { return _vehicle;}

    // Property setters
    void setTakeOffPosition             (QGeoCoordinate coordinate);
    void setLandPosition                (QGeoCoordinate coordinate);
    void setVehicle                     (Vehicle* vehicle);

signals:
    void takeOffPositionChanged         (QGeoCoordinate takeOffPos);
    void landPositionChanged            (QGeoCoordinate landPos);
    void vehicleChanged                 (Vehicle* vehicle);

private:
    QGeoCoordinate      _takeOffPosition;
    QGeoCoordinate      _landPosition;
    Vehicle*            _vehicle;
};

#endif // WIMASERVICEPOLYGON_H