Newer
Older
#include "QGCMapPolygon.h"
#include "Vehicle.h"
#include "qobject.h"
#include "WimaVehicle.h"
class WimaArea : public QGCMapPolygon //abstract base class for all WimaAreas
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
42
43
44
45
46
47
48
49
50
51
WimaArea(QObject* parent = nullptr);
WimaArea(WimaArea* other, QObject* parent = nullptr);
~WimaArea();
Q_PROPERTY(double maxAltitude READ maxAltitude WRITE setMaxAltitude NOTIFY maxAltitudeChanged)
Q_PROPERTY(QString mapVisualQML READ mapVisualQML CONSTANT)
Q_PROPERTY(QString editorQML READ editorQML CONSTANT)
Q_PROPERTY(WimaVehicle* vehicle READ vehicle WRITE setVehicle NOTIFY vehicleChanged)
//Property accessors
double maxAltitude (void) const { return _maxAltitude;}
WimaVehicle* vehicle (void) const { return _wimaVehicle;}
virtual QString mapVisualQML (void) const = 0;
virtual QString editorQML (void) const = 0;
//Property setters
void setMaxAltitude (double alt);
void setVehicle (WimaVehicle* vehicle);
// Member Methodes
/*template <class T>
QList<T*>* splitArea (WimaArea *polygonToSplitt, int numberOfFractions); // use QScopedPointer to store return value
template <class T>
QList<T*>* splitArea (int numberOfFractions); // use QScopedPointer to store return value*/
//iterates over all vertices in _polygon and returns the index of that one closest to coordinate
int getClosestVertexIndex (QGeoCoordinate coordinate);
//iterates over all vertices in _polygon and returns that one closest to coordinate
QGeoCoordinate getClosestVertex (QGeoCoordinate coordinate);
signals:
void maxAltitudeChanged (void);
void vehicleChanged (void);
protected:
double _maxAltitude;
WimaVehicle* _wimaVehicle;