#pragma once

#include <QGeoCoordinate>
#include <QObject>

#include "Geometry/WimaAreaData.h"
#include "Geometry/WimaCorridorData.h"
#include "Geometry/WimaJoinedAreaData.h"
#include "Geometry/WimaMeasurementAreaData.h"
#include "Geometry/WimaServiceAreaData.h"
#include "MissionItem.h"

class WimaPlanData : public QObject {
  Q_OBJECT
public:
  WimaPlanData(QObject *parent = nullptr);
  WimaPlanData(const WimaPlanData &other, QObject *parent = nullptr);
  WimaPlanData &operator=(const WimaPlanData &other);

  // Member Methodes
  void append(const WimaJoinedAreaData &areaData);
  void append(const WimaServiceAreaData &areaData);
  void append(const WimaCorridorData &areaData);
  void append(const WimaMeasurementAreaData &areaData);

  void setTransects(const QList<QList<QGeoCoordinate>> &transects);
  //!
  //! \brief append
  //! \param missionItems
  //! \note Takes owenership of MissionItems*
  void append(const QList<MissionItem *> &missionItems);
  void clear();

  const QList<const WimaAreaData *> &areaList() const;
  const QList<QList<QGeoCoordinate>> &transects() const;
  const QList<MissionItem *> &missionItems() const;

  bool operator==(const WimaPlanData &other) const;
  bool operator!=(const WimaPlanData &other) const;

signals:
  void areaListChanged();

private:
  WimaJoinedAreaData _joinedArea;
  WimaServiceAreaData _serviceArea;
  WimaCorridorData _corridor;
  WimaMeasurementAreaData _measurementArea;
  QList<const WimaAreaData *> _areaList;
};
