MeasurementTile.h 888 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
#pragma once

#include "geometry/GeoArea.h"

#include <QGeoCoordinate>

class MeasurementTile : public GeoArea {
  Q_OBJECT
public:
  MeasurementTile(QObject *parent = nullptr);
  MeasurementTile(const MeasurementTile &other, QObject *parent = nullptr);
  ~MeasurementTile();

  MeasurementTile &operator=(const MeasurementTile &other);

  Q_PROPERTY(double progress READ progress NOTIFY progressChanged)
  Q_PROPERTY(long id READ id NOTIFY idChanged)

  virtual QString mapVisualQML() const override;
  virtual QString editorQML() const override;
  virtual MeasurementTile *clone(QObject *parent) const;

  void push_back(const QGeoCoordinate &c);

  double progress() const;
  void setProgress(double progress);

  uint64_t id() const;
  void setId(const uint64_t &id);

signals:
  void progressChanged();
  void idChanged();

private:
  void init();
  double _progress;
  long _id;
};