WimaArea.h 1008 Bytes
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
#pragma once

#include "QGCGeo.h"
#include "QGCMapPolygon.h"
#include "QGCMapPolyline.h"
#include "Vehicle.h"
#include "qobject.h"
#include <QLineF>
#include <QPair>
#include <QPointF>

#include "GeoUtilities.h"
#include "PlanimetryCalculus.h"
#include "PolygonCalculus.h"

class WimaArea : public QGCMapPolygon // abstract base class for all WimaAreas
{
  Q_OBJECT
public:
  WimaArea(QObject *parent = nullptr);
  WimaArea(const WimaArea &other, QObject *parent = nullptr);
  WimaArea &operator=(const WimaArea &other);

  Q_PROPERTY(QString mapVisualQML READ mapVisualQML CONSTANT)
  Q_PROPERTY(QString editorQML READ editorQML CONSTANT)

  virtual QString mapVisualQML(void) const = 0;
  virtual QString editorQML(void) const = 0;

  void saveToJson(QJsonObject &jsonObject);
  bool loadFromJson(const QJsonObject &jsonObject, QString &errorString);

  // static Members
  static const char *wimaAreaName;
  static const char *areaTypeName;
  static const char *settingsGroup;

private:
  void init();
};