SnakeDataManager.h 1.57 KB
Newer Older
1 2
#pragma once

3 4
#include <QGeoCoordinate>
#include <QList>
5 6 7
#include <QObject>
#include <QThread>

8 9
#include "QNemoProgress.h"
#include "SnakeTiles.h"
Valentin Platzgummer's avatar
Valentin Platzgummer committed
10
#include "SnakeTilesLocal.h"
11

12
#include <boost/units/systems/si.hpp>
13 14 15 16 17

using namespace boost::units;
using Length = quantity<si::length>;
using Area = quantity<si::area>;

18 19
class SnakeDataManager : public QThread {
  Q_OBJECT
20

Valentin Platzgummer's avatar
Valentin Platzgummer committed
21 22
  class Impl;
  using PImpl = std::unique_ptr<Impl>;
23

24 25 26
public:
  SnakeDataManager(QObject *parent = nullptr);
  ~SnakeDataManager() override;
27

28 29 30
  void setMeasurementArea(const QList<QGeoCoordinate> &measurementArea);
  void setServiceArea(const QList<QGeoCoordinate> &serviceArea);
  void setCorridor(const QList<QGeoCoordinate> &corridor);
31

Valentin Platzgummer's avatar
Valentin Platzgummer committed
32 33 34
  SnakeTiles tiles() const;
  SnakeTilesLocal tilesENU() const;
  QGeoCoordinate ENUOrigin() const;
35
  QVariantList tileCenterPoints() const;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
36
  QNemoProgress progress() const;
37 38 39
  bool calcInProgress() const;
  QString errorMessage() const;
  bool success() const;
40

41 42 43
  QVector<QGeoCoordinate> waypoints() const;
  QVector<QGeoCoordinate> arrivalPath() const;
  QVector<QGeoCoordinate> returnPath() const;
44

45 46
  Length lineDistance() const;
  void setLineDistance(Length lineDistance);
47

48 49
  Length minTransectLength() const;
  void setMinTransectLength(Length minTransectLength);
50

51 52
  Area minTileArea() const;
  void setMinTileArea(Area minTileArea);
53

54 55
  Length tileHeight() const;
  void setTileHeight(Length tileHeight);
56

57 58
  Length tileWidth() const;
  void setTileWidth(Length tileWidth);
59

60
signals:
61
  void calcInProgressChanged(bool inProgress);
62 63

protected:
64 65
  void run() override;

66
private:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
67
  PImpl pImpl;
68
};