#include "GeneratorBase.h"

#include <QGeoCoordinate>

#include "SettingsFact.h"

class MeasurementArea;
class SafeArea;

namespace routing {

class LinearGenerator : public GeneratorBase {
  Q_OBJECT
public:
  LinearGenerator(QObject *parent = nullptr);
  LinearGenerator(Data d, QObject *parent = nullptr);

  Q_PROPERTY(Fact *distance READ distance CONSTANT)
  Q_PROPERTY(Fact *alpha READ alpha CONSTANT)
  Q_PROPERTY(Fact *minLength READ minLength CONSTANT)

  virtual QString editorQml() override;
  virtual QString mapVisualQml() override;

  virtual QString name() override;
  virtual QString abbreviation() override;

  virtual bool get(Generator &generator) override;

  Fact *distance();
  Fact *alpha();
  Fact *minLength();

  static const char *settingsGroup;
  static const char *distanceName;
  static const char *alphaName;
  static const char *minLengthName;

private:
  void onAreaListChanged();
  void setMeasurementArea(MeasurementArea *area);

  QMap<QString, FactMetaData *> _metaDataMap;
  SettingsFact _distance;
  SettingsFact _alpha;
  SettingsFact _minLength;
  MeasurementArea *_measurementArea;
  SafeArea *_safeArea;
};

} // namespace routing
