GeneratorBase.h 839 Bytes
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7
#include <QObject>

#include <functional>
#include <memory>

#include "snake.h"

8
#include "Wima/WimaPlanData.h"
Valentin Platzgummer's avatar
Valentin Platzgummer committed
9 10 11 12 13 14

namespace routing {

class GeneratorBase : public QObject {
  Q_OBJECT
public:
15
  using Data = std::shared_ptr<WimaPlanData>;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
16 17 18
  using Generator = std::function<bool(snake::Transects &)>;

  explicit GeneratorBase(QObject *parent = nullptr);
19
  explicit GeneratorBase(Data d, QObject *parent = nullptr);
Valentin Platzgummer's avatar
Valentin Platzgummer committed
20 21 22 23 24 25 26 27
  ~GeneratorBase();

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

  virtual QString name() = 0;
  virtual QString abbreviation() = 0;

28 29 30 31
  virtual bool get(Generator &generator) = 0;

  Data data() const;
  void setData(const Data &d);
Valentin Platzgummer's avatar
Valentin Platzgummer committed
32

33 34
signals:
  void generatorChanged();
35 36 37 38 39

protected:
  virtual void establishConnections();
  virtual void deleteConnections();
  Data _d;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
40 41 42
};

} // namespace routing