Commit 9f857268 authored by Valentin Platzgummer's avatar Valentin Platzgummer
parents 8eb85f52 6af0d454
This diff is collapsed.
...@@ -418,6 +418,9 @@ HEADERS += \ ...@@ -418,6 +418,9 @@ HEADERS += \
src/Wima/GenericSingelton.h \ src/Wima/GenericSingelton.h \
src/Wima/Geometry/GenericCircle.h \ src/Wima/Geometry/GenericCircle.h \
src/Wima/RoutingThread.h \ src/Wima/RoutingThread.h \
src/Wima/Snake/CircularGenerator.h \
src/Wima/Snake/GeneratorBase.h \
src/Wima/Snake/LinearGenerator.h \
src/Wima/Snake/clipper/clipper.hpp \ src/Wima/Snake/clipper/clipper.hpp \
src/Wima/Snake/mapbox/feature.hpp \ src/Wima/Snake/mapbox/feature.hpp \
src/Wima/Snake/mapbox/geometry.hpp \ src/Wima/Snake/mapbox/geometry.hpp \
...@@ -510,6 +513,9 @@ SOURCES += \ ...@@ -510,6 +513,9 @@ SOURCES += \
src/Wima/CircularSurvey.cc \ src/Wima/CircularSurvey.cc \
src/Wima/GenericSingelton.cpp \ src/Wima/GenericSingelton.cpp \
src/Wima/RoutingThread.cpp \ src/Wima/RoutingThread.cpp \
src/Wima/Snake/CircularGenerator.cpp \
src/Wima/Snake/GeneratorBase.cc \
src/Wima/Snake/LinearGenerator.cpp \
src/Wima/Snake/clipper/clipper.cpp \ src/Wima/Snake/clipper/clipper.cpp \
src/Wima/Snake/snake.cpp \ src/Wima/Snake/snake.cpp \
src/Wima/Geometry/GeoPoint3D.cpp \ src/Wima/Geometry/GeoPoint3D.cpp \
...@@ -1449,5 +1455,8 @@ contains (CONFIG, QGC_DISABLE_INSTALLER_SETUP) { ...@@ -1449,5 +1455,8 @@ contains (CONFIG, QGC_DISABLE_INSTALLER_SETUP) {
} }
DISTFILES += \ DISTFILES += \
src/Wima/Routing/json/CircularGenerator.SettingsGroup.json \
src/Wima/Snake/json/LinearGenerator.SettingsGroup.json \
src/Wima/json/CircularSurvey.SettingsGroup.json \
src/WimaView/WimaMeasurementAreaEditor.qml \ src/WimaView/WimaMeasurementAreaEditor.qml \
src/Settings/Wima.SettingsGroup.json src/Settings/Wima.SettingsGroup.json
This diff is collapsed.
...@@ -24,6 +24,8 @@ import QGroundControl.Palette 1.0 ...@@ -24,6 +24,8 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
import Wima 1.0
FlightMap { FlightMap {
id: flightMap id: flightMap
anchors.fill: parent anchors.fill: parent
......
...@@ -30,5 +30,9 @@ MapItemView { ...@@ -30,5 +30,9 @@ MapItemView {
object.coordinate1, object.coordinate1,
object.coordinate2, object.coordinate2,
] : [] ] : []
// onParentChanged: {
// console.log("MapItemView, path:" + path)
// }
} }
} }
...@@ -15,7 +15,7 @@ import QtPositioning 5.3 ...@@ -15,7 +15,7 @@ import QtPositioning 5.3
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import Wima 1.0
/// Mission item map visual /// Mission item map visual
Item { Item {
......
...@@ -89,6 +89,8 @@ ...@@ -89,6 +89,8 @@
#include "VideoSurface.h" #include "VideoSurface.h"
#include "ViewWidgetController.h" #include "ViewWidgetController.h"
#include "VisualMissionItem.h" #include "VisualMissionItem.h"
#include "Wima/Snake/CircularGenerator.h"
#include "Wima/Snake/LinearGenerator.h"
#include "Wima/Snake/NemoInterface.h" #include "Wima/Snake/NemoInterface.h"
#include "Wima/WimaController.h" #include "Wima/WimaController.h"
#include "Wima/WimaPlaner.h" #include "Wima/WimaPlaner.h"
...@@ -520,6 +522,10 @@ void QGCApplication::_initCommon(void) { ...@@ -520,6 +522,10 @@ void QGCApplication::_initCommon(void) {
qmlRegisterType<WimaController>("Wima", 1, 0, "WimaController"); qmlRegisterType<WimaController>("Wima", 1, 0, "WimaController");
qmlRegisterType<WimaPlaner>("Wima", 1, 0, "WimaPlaner"); qmlRegisterType<WimaPlaner>("Wima", 1, 0, "WimaPlaner");
qmlRegisterType<NemoInterface>("Wima", 1, 0, "NemoInterface"); qmlRegisterType<NemoInterface>("Wima", 1, 0, "NemoInterface");
qmlRegisterInterface<routing::GeneratorBase>("GeneratorBase");
qmlRegisterType<routing::CircularGenerator>("Wima", 1, 0,
"CircularGenerator");
qmlRegisterType<routing::LinearGenerator>("Wima", 1, 0, "LinearGenerator");
// Register Qml Singletons // Register Qml Singletons
qmlRegisterSingletonType<QGroundControlQmlGlobal>( qmlRegisterSingletonType<QGroundControlQmlGlobal>(
......
...@@ -65,7 +65,6 @@ QGCViewDialog 1.0 QGCViewDialog.qml ...@@ -65,7 +65,6 @@ QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml
QGCViewMessage 1.0 QGCViewMessage.qml QGCViewMessage 1.0 QGCViewMessage.qml
QGCViewPanel 1.0 QGCViewPanel.qml QGCViewPanel 1.0 QGCViewPanel.qml
WimaToolBar 1.0 WimaToolBar.qml
RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml
RallyPointItemEditor 1.0 RallyPointItemEditor.qml RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml
...@@ -85,22 +84,6 @@ VehicleSummaryRow 1.0 VehicleSummaryRow.qml ...@@ -85,22 +84,6 @@ VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml ViewWidget 1.0 ViewWidget.qml
FlyAreaItemEditor 1.0 FlyAreaItemEditor.qml FlyAreaItemEditor 1.0 FlyAreaItemEditor.qml
WimaMapVisual 1.0 WimaMapVisual.qml
WimaMeasurementAreaMapVisual 1.0 WimaMeasurementAreaMapVisual.qml
WimaJoinedAreaMapVisual 1.0 WimaJoinedAreaMapVisual.qml
WimaMeasurementAreaEditor 1.0 WimaMeasurementAreaEditor.qml
WimaServiceAreaMapVisual 1.0 WimaServiceAreaMapVisual.qml
WimaAreaMapVisual 1.0 WimaAreaMapVisual.qml
WimaServiceAreaEditor 1.0 WimaServiceAreaEditor.qml
WimaCorridorMapVisual 1.0 WimaCorridorMapVisual.qml
WimaItemEditor 1.0 WimaItemEditor.qml
WimaMapPolygonVisuals 1.0 WimaMapPolygonVisuals.qml
WimaMapPolylineVisuals 1.0 WimaMapPolylineVisuals.qml
CircularSurveyMapVisual 1.0 CircularSurveyMapVisual.qml
DragCoordinate 1.0 DragCoordinate.qml
CoordinateIndicator 1.0 CoordinateIndicator.qml
CoordinateIndicatorDrag 1.0 CoordinateIndicatorDrag.qml
ProgressIndicator 1.0 ProgressIndicator.qml
QGCButtonColumn 1.0 QGCButtonColumn.qml QGCButtonColumn 1.0 QGCButtonColumn.qml
This diff is collapsed.
...@@ -2,26 +2,30 @@ ...@@ -2,26 +2,30 @@
#include <QFutureWatcher> #include <QFutureWatcher>
#include <QVector> #include <QVector>
#include <memory>
#include "SettingsFact.h" #include "SettingsFact.h"
#include "TransectStyleComplexItem.h" #include "TransectStyleComplexItem.h"
#include "Geometry/WimaJoinedAreaData.h" #include "Geometry/WimaJoinedAreaData.h"
#include "Geometry/WimaMeasurementAreaData.h" #include "Geometry/WimaMeasurementAreaData.h"
#include "WimaPlanData.h"
class RoutingThread; class RoutingThread;
class RoutingData; class RoutingData;
namespace routing {
class GeneratorBase;
}
class CircularSurvey : public TransectStyleComplexItem { class CircularSurvey : public TransectStyleComplexItem {
Q_OBJECT Q_OBJECT
public:
using PtrRoutingData = QSharedPointer<RoutingData>;
enum class Type {
Circular = 0,
Linear = 1,
Count = 2 // Must me last, onyl for counting
};
using PtrGenerator = std::shared_ptr<routing::GeneratorBase>;
using PtrRoutingData = std::shared_ptr<RoutingData>;
using PtrWorker = std::shared_ptr<RoutingThread>;
public:
/// @param vehicle Vehicle which this is being contructed for /// @param vehicle Vehicle which this is being contructed for
/// @param flyView true: Created for use in the Fly View, false: Created for /// @param flyView true: Created for use in the Fly View, false: Created for
/// use in the Plan View /// use in the Plan View
...@@ -31,50 +35,27 @@ public: ...@@ -31,50 +35,27 @@ public:
QObject *parent); QObject *parent);
~CircularSurvey(); ~CircularSurvey();
Q_PROPERTY(QGeoCoordinate refPoint READ refPoint WRITE setRefPoint NOTIFY
refPointChanged)
Q_PROPERTY(Fact *transectDistance READ transectDistance CONSTANT)
Q_PROPERTY(Fact *alpha READ alpha CONSTANT)
Q_PROPERTY(Fact *minLength READ minLength CONSTANT)
Q_PROPERTY(Fact *type READ type CONSTANT)
Q_PROPERTY(Fact *variant READ variant CONSTANT) Q_PROPERTY(Fact *variant READ variant CONSTANT)
Q_PROPERTY(Fact *numRuns READ numRuns CONSTANT) Q_PROPERTY(
Q_PROPERTY(Fact *run READ run CONSTANT) QStringList variantNames READ variantNames NOTIFY variantNamesChanged)
Q_PROPERTY(int typeCount READ typeCount CONSTANT) Q_PROPERTY(QStringList generatorNameList READ generatorNameList NOTIFY
generatorNameListChanged)
Q_PROPERTY(bool calculating READ calculating NOTIFY calculatingChanged) Q_PROPERTY(bool calculating READ calculating NOTIFY calculatingChanged)
Q_PROPERTY(bool hidePolygon READ hidePolygon NOTIFY hidePolygonChanged)
Q_PROPERTY( Q_PROPERTY(
QList<QString> variantNames READ variantNames NOTIFY variantNamesChanged) routing::GeneratorBase *generator READ generator NOTIFY generatorChanged)
Q_PROPERTY(QList<QString> runNames READ runNames NOTIFY runNamesChanged) Q_PROPERTY(int generatorIndex READ generatorIndex NOTIFY generatorChanged)
Q_INVOKABLE void resetReference(void);
Q_INVOKABLE void reverse(void); Q_INVOKABLE void reverse(void);
// Property setters // Property setters
void setRefPoint(const QGeoCoordinate &refPt); void setPlanData(const WimaPlanData &d);
void setHidePolygon(bool hide);
void setMeasurementArea(const WimaMeasurementAreaData &mArea);
void setJoinedArea(const WimaJoinedAreaData &jArea);
void setMeasurementArea(const WimaMeasurementArea &mArea);
void setJoinedArea(const WimaJoinedArea &jArea);
void setDepot(const QGeoCoordinate &depot);
// Property getters // Property getters
QGeoCoordinate refPoint() const; const WimaPlanData &planData() const;
Fact *transectDistance(); WimaPlanData &planData();
Fact *alpha();
Fact *minLength();
Fact *type();
Fact *variant(); Fact *variant();
Fact *numRuns(); QStringList variantNames() const;
Fact *run();
int typeCount() const;
bool calculating() const; bool calculating() const;
bool hidePolygon() const;
QList<QString> variantNames() const;
QList<QString> runNames() const;
QGeoCoordinate depot() const;
const QList<QList<QGeoCoordinate>> &rawTransects() const;
// Overrides // Overrides
bool load(const QJsonObject &complexObject, int sequenceNumber, bool load(const QJsonObject &complexObject, int sequenceNumber,
...@@ -92,91 +73,73 @@ public: ...@@ -92,91 +73,73 @@ public:
bool readyForSave(void) const override final; bool readyForSave(void) const override final;
double additionalTimeDelay(void) const override final; double additionalTimeDelay(void) const override final;
// Generator
bool registerGenerator(const QString &name,
std::shared_ptr<routing::GeneratorBase> g);
bool unregisterGenerator(const QString &name);
bool unregisterGenerator(int index);
Q_INVOKABLE bool switchToGenerator(const QString &name);
Q_INVOKABLE bool switchToGenerator(int index);
QStringList generatorNameList();
routing::GeneratorBase *generator();
int generatorIndex();
static const char *settingsGroup; static const char *settingsGroup;
static const char *transectDistanceName;
static const char *alphaName;
static const char *minLengthName;
static const char *typeName;
static const char *variantName; static const char *variantName;
static const char *numRunsName;
static const char *runName;
static const char *CircularSurveyName; static const char *CircularSurveyName;
static const char *refPointLongitudeName;
static const char *refPointLatitudeName;
static const char *refPointAltitudeName;
signals: signals:
void refPointChanged();
void calculatingChanged(); void calculatingChanged();
void hidePolygonChanged();
void depotChanged();
void variantNamesChanged(); void variantNamesChanged();
void runNamesChanged(); void generatorNameListChanged();
void measurementAreaChanged(); void generatorChanged();
void joinedAreaChanged();
private slots: private slots:
// Overrides from TransectStyleComplexItem // Overrides from TransectStyleComplexItem
void _rebuildTransectsPhase1(void) final; void _rebuildTransectsPhase1(void) final;
void _recalcComplexDistance(void) final; void _recalcComplexDistance(void) final;
void _recalcCameraShots(void) final; void _recalcCameraShots(void) final;
// Worker functions.
void _setTransects(PtrRoutingData pRoute); void _setTransects(PtrRoutingData pRoute);
void _changeVariant();
void _updateWorker();
void _changeVariantWorker();
void _reverseWorker();
private: private:
void _appendLoadedMissionItems(QList<MissionItem *> &items, void _appendLoadedMissionItems(QList<MissionItem *> &items,
QObject *missionItemParent); QObject *missionItemParent);
void _buildAndAppendMissionItems(QList<MissionItem *> &items, void _buildAndAppendMissionItems(QList<MissionItem *> &items,
QObject *missionItemParent); QObject *missionItemParent);
void _changeVariant();
void _changeRun();
void _updateWorker(); bool _switchToGenerator(const PtrGenerator &newG);
void _changeVariantRunWorker();
void _reverseWorker();
void _storeWorker();
void _changeRunWorker();
// center of the circular lanes, e.g. base station
QGeoCoordinate _referencePoint;
QMap<QString, FactMetaData *> _metaDataMap;
// distance between two neighbour circles
SettingsFact _transectDistance;
// angle discretisation of the circles
SettingsFact _alpha;
// minimal transect lenght, transects are rejected if they are shorter than
// this value
SettingsFact _minLength;
SettingsFact _type;
SettingsFact _variant;
QList<QString> _variantNames;
SettingsFact _numRuns;
SettingsFact _run;
QList<QString> _runNames;
// Area data
WimaMeasurementAreaData _mArea;
WimaJoinedAreaData _jArea;
QGeoCoordinate _depot;
// Worker
using PtrWorker = std::shared_ptr<RoutingThread>;
PtrWorker _pWorker;
PtrRoutingData _pRoutingData;
// Routing data.
QList<QList<QGeoCoordinate>> _rawTransects;
using Runs = QVector<Transects>;
QVector<Runs> _variantVector;
// State. // State.
enum class STATE { enum class STATE {
DEFAULT, IDLE,
STORE, SKIPP,
REVERSE, REVERSE,
VARIANT_CHANGE, VARIANT_CHANGE,
RUN_CHANGE, RUN_CHANGE,
}; };
STATE _state; STATE _state;
bool _hidePolygon; // center of the circular lanes, e.g. base station
QMap<QString, FactMetaData *> _metaDataMap;
SettingsFact _variant;
QStringList _variantNames;
// Area data
std::shared_ptr<WimaPlanData> _pAreaData;
// Generators
QList<PtrGenerator> _generatorList;
QStringList _generatorNameList;
PtrGenerator _pGenerator;
// Routing.
using Variant = Transects;
QVector<Variant> _variantVector;
PtrWorker _pWorker;
}; };
...@@ -2,7 +2,14 @@ ...@@ -2,7 +2,14 @@
WimaAreaData::WimaAreaData(QObject *parent) : QObject(parent) {} WimaAreaData::WimaAreaData(QObject *parent) : QObject(parent) {}
WimaAreaData::~WimaAreaData() {} WimaAreaData::WimaAreaData(const WimaAreaData &other, QObject *parent)
: QObject(parent), _path(other._path), _list(other._list),
_center(other._center) {}
WimaAreaData::WimaAreaData(const WimaArea &otherData, QObject *parent)
: QObject(parent), _center(otherData.center()) {
_setPathImpl(otherData.path());
}
bool WimaAreaData::operator==(const WimaAreaData &data) const { bool WimaAreaData::operator==(const WimaAreaData &data) const {
return this->_path == data._path && this->_center == data._center; return this->_path == data._path && this->_center == data._center;
...@@ -25,7 +32,7 @@ bool WimaAreaData::containsCoordinate(const QGeoCoordinate &coordinate) const { ...@@ -25,7 +32,7 @@ bool WimaAreaData::containsCoordinate(const QGeoCoordinate &coordinate) const {
using namespace PolygonCalculus; using namespace PolygonCalculus;
using namespace GeoUtilities; using namespace GeoUtilities;
if (_path.size() > 2) { if (this->coordinateList().size() > 2) {
QPolygonF polygon; QPolygonF polygon;
toCartesianList(this->coordinateList(), coordinate, polygon); toCartesianList(this->coordinateList(), coordinate, polygon);
return PlanimetryCalculus::contains(polygon, QPointF(0, 0)); return PlanimetryCalculus::contains(polygon, QPointF(0, 0));
...@@ -36,44 +43,60 @@ bool WimaAreaData::containsCoordinate(const QGeoCoordinate &coordinate) const { ...@@ -36,44 +43,60 @@ bool WimaAreaData::containsCoordinate(const QGeoCoordinate &coordinate) const {
void WimaAreaData::append(const QGeoCoordinate &c) { void WimaAreaData::append(const QGeoCoordinate &c) {
_list.append(c); _list.append(c);
_path.push_back(QVariant::fromValue(c)); _path.push_back(QVariant::fromValue(c));
emit pathChanged();
} }
void WimaAreaData::push_back(const QGeoCoordinate &c) { append(c); } void WimaAreaData::push_back(const QGeoCoordinate &c) { append(c); }
void WimaAreaData::clear() { void WimaAreaData::clear() {
_list.clear(); if (_list.size() > 0 || _path.size() > 0) {
_path.clear(); _list.clear();
_path.clear();
emit pathChanged();
}
} }
void WimaAreaData::setPath(const QVariantList &coordinateList) { void WimaAreaData::setPath(const QVariantList &coordinateList) {
_path = coordinateList; if (_path != coordinateList) {
_list.clear(); _setPathImpl(coordinateList);
for (auto variant : coordinateList) { emit pathChanged();
_list.push_back(variant.value<QGeoCoordinate>());
} }
} }
void WimaAreaData::setCenter(const QGeoCoordinate &center) { void WimaAreaData::setCenter(const QGeoCoordinate &center) {
if (_center != center) { if (_center != center) {
_center = center; _center = center;
emit centerChanged(); emit centerChanged();
} }
} }
/*! WimaAreaData &WimaAreaData::operator=(const WimaAreaData &otherData) {
* \fn void WimaAreaData::assign(const WimaAreaData &other) setPath(otherData._list);
* setCenter(otherData._center);
* Assigns \a other to the invoking object return *this;
*/
void WimaAreaData::assign(const WimaAreaData &other) {
setPath(other.path());
setCenter(other.center());
} }
void WimaAreaData::assign(const WimaArea &other) { WimaAreaData &WimaAreaData::operator=(const WimaArea &otherData) {
setPath(other.path()); setPath(otherData.path());
setCenter(other.center()); setCenter(otherData.center());
return *this;
}
void WimaAreaData::_setPathImpl(const QList<QGeoCoordinate> &coordinateList) {
_list = coordinateList;
_path.clear();
// copy all coordinates to _path
for (const auto &vertex : coordinateList) {
_path.append(QVariant::fromValue(vertex));
}
}
void WimaAreaData::_setPathImpl(const QVariantList &coordinateList) {
_path = coordinateList;
_list.clear();
for (const auto &variant : coordinateList) {
_list.push_back(variant.value<QGeoCoordinate>());
}
} }
/*! /*!
...@@ -83,24 +106,26 @@ void WimaAreaData::assign(const WimaArea &other) { ...@@ -83,24 +106,26 @@ void WimaAreaData::assign(const WimaArea &other) {
* coordinateList. Emits the \c pathChanged() signal. * coordinateList. Emits the \c pathChanged() signal.
*/ */
void WimaAreaData::setPath(const QList<QGeoCoordinate> &coordinateList) { void WimaAreaData::setPath(const QList<QGeoCoordinate> &coordinateList) {
_list = coordinateList; if (_list != coordinateList) {
_setPathImpl(coordinateList);
_path.clear(); emit pathChanged();
// copy all coordinates to _path
for (int i = 0; i < coordinateList.size(); i++) {
_path.append(QVariant::fromValue(coordinateList.value(i)));
} }
emit pathChanged(_path);
} }
bool operator==(const WimaAreaData &m1, const WimaArea &m2) { bool operator==(const WimaAreaData &m1, const WimaArea &m2) {
return m1.path() == m2.path() && m1.center() == m2.center(); return m1.path() == m2.path() && m1.center() == m2.center();
} }
bool operator!=(const WimaAreaData &m1, const WimaArea &m2) { bool operator!=(const WimaAreaData &m1, const WimaArea &m2) {
return !operator==(m1, m2); return !operator==(m1, m2);
} }
bool operator==(const WimaArea &m1, const WimaAreaData &m2) { return m2 == m1; }
bool operator!=(const WimaArea &m1, const WimaAreaData &m2) {
return !operator==(m2, m1);
}
/*! /*!
* \class WimaArea::WimaAreaData * \class WimaArea::WimaAreaData
* \brief Class to store and exchange data of a \c WimaArea Object. * \brief Class to store and exchange data of a \c WimaArea Object.
......
#pragma once #pragma once
#include <QObject> #include <QObject>
...@@ -11,16 +11,12 @@ class WimaAreaData ...@@ -11,16 +11,12 @@ class WimaAreaData
{ {
Q_OBJECT Q_OBJECT
public: public:
WimaAreaData(QObject *parent = nullptr);
Q_PROPERTY(const QVariantList path READ path NOTIFY pathChanged) Q_PROPERTY(const QVariantList path READ path NOTIFY pathChanged)
Q_PROPERTY(QString type READ type CONSTANT) Q_PROPERTY(QString type READ type CONSTANT)
Q_PROPERTY(QString mapVisualQML READ mapVisualQML CONSTANT) Q_PROPERTY(QString mapVisualQML READ mapVisualQML CONSTANT)
WimaAreaData(QObject *parent = nullptr);
~WimaAreaData();
WimaAreaData(const WimaAreaData &otherData) = delete; // avoid slicing
WimaAreaData &
operator=(const WimaAreaData &otherData) = delete; // avoid slicing
bool operator==(const WimaAreaData &data) const; bool operator==(const WimaAreaData &data) const;
bool operator!=(const WimaAreaData &data) const; bool operator!=(const WimaAreaData &data) const;
...@@ -37,8 +33,8 @@ public: ...@@ -37,8 +33,8 @@ public:
void clear(); void clear();
signals: signals:
void pathChanged(const QVariantList &coordinateList); void pathChanged();
void centerChanged(void); void centerChanged();
public slots: public slots:
void setPath(const QList<QGeoCoordinate> &coordinateList); void setPath(const QList<QGeoCoordinate> &coordinateList);
...@@ -46,18 +42,21 @@ public slots: ...@@ -46,18 +42,21 @@ public slots:
void setCenter(const QGeoCoordinate &center); void setCenter(const QGeoCoordinate &center);
protected: protected:
void assign(const WimaAreaData &other); WimaAreaData(const WimaAreaData &otherData, QObject *parent);
void assign(const WimaArea &other); WimaAreaData(const WimaArea &otherData, QObject *parent);
WimaAreaData &operator=(const WimaAreaData &otherData);
WimaAreaData &operator=(const WimaArea &otherData);
private: private:
// Member Functions void _setPathImpl(const QList<QGeoCoordinate> &coordinateList);
void _setPathImpl(const QVariantList &coordinateList);
// Member Variables // Member Variables
// see WimaArea.h for explanation mutable QVariantList _path;
QVariantList _path; QList<QGeoCoordinate> _list;
mutable QList<QGeoCoordinate> _list;
QGeoCoordinate _center; QGeoCoordinate _center;
}; };
bool operator==(const WimaAreaData &m1, const WimaArea &m2); bool operator==(const WimaAreaData &m1, const WimaArea &m2);
bool operator!=(const WimaAreaData &m1, const WimaArea &m2); bool operator!=(const WimaAreaData &m1, const WimaArea &m2);
bool operator==(const WimaArea &m1, const WimaAreaData &m2);
bool operator!=(const WimaArea &m1, const WimaAreaData &m2);
...@@ -6,14 +6,10 @@ WimaCorridorData::WimaCorridorData(QObject *parent) : WimaAreaData(parent) {} ...@@ -6,14 +6,10 @@ WimaCorridorData::WimaCorridorData(QObject *parent) : WimaAreaData(parent) {}
WimaCorridorData::WimaCorridorData(const WimaCorridorData &other, WimaCorridorData::WimaCorridorData(const WimaCorridorData &other,
QObject *parent) QObject *parent)