#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)

  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);

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

  QList<QGeoCoordinate> tile() const;

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

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