#include "WimaMeasurementAreaData.h" #include "SnakeTile.h" const char *WimaMeasurementAreaData::typeString = "WimaMeasurementAreaData"; WimaMeasurementAreaData::WimaMeasurementAreaData(QObject *parent) : WimaAreaData(parent) {} WimaMeasurementAreaData::WimaMeasurementAreaData( const WimaMeasurementAreaData &other, QObject *parent) : WimaAreaData(parent) { *this = other; } WimaMeasurementAreaData::WimaMeasurementAreaData( const WimaMeasurementArea &other, QObject *parent) : WimaAreaData(parent) { *this = other; } bool WimaMeasurementAreaData:: operator==(const WimaMeasurementAreaData &other) const { return this->WimaAreaData::operator==(other) && this->_tileData == other.tileData() && this->center() == other.center(); } bool WimaMeasurementAreaData:: operator!=(const WimaMeasurementAreaData &other) const { return !(*this == other); } /*! * \overload operator=(); * * Assigns \a other to the invoking object. */ WimaMeasurementAreaData &WimaMeasurementAreaData:: operator=(const WimaMeasurementAreaData &other) { assign(other); return *this; } /*! * \overload operator=(); * * Assigns \a other to the invoking object. */ WimaMeasurementAreaData &WimaMeasurementAreaData:: operator=(const WimaMeasurementArea &other) { assign(other); return *this; } QString WimaMeasurementAreaData::type() const { return this->typeString; } QmlObjectListModel *WimaMeasurementAreaData::tiles() { return &this->_tileData.tiles; } const QmlObjectListModel *WimaMeasurementAreaData::tiles() const { return &this->_tileData.tiles; } const QVariantList &WimaMeasurementAreaData::tileCenterPoints() const { return this->_tileData.tileCenterPoints; } QVariantList &WimaMeasurementAreaData::tileCenterPoints() { return this->_tileData.tileCenterPoints; } const TileData &WimaMeasurementAreaData::tileData() const { return this->_tileData; } TileData &WimaMeasurementAreaData::tileData() { return this->_tileData; } const QVector &WimaMeasurementAreaData::progress() const { return this->_progress; } QVector &WimaMeasurementAreaData::progress() { return this->_progress; } void WimaMeasurementAreaData::assign(const WimaMeasurementAreaData &other) { WimaAreaData::assign(other); this->_tileData = other._tileData; this->_progress = other._progress; } void WimaMeasurementAreaData::assign(const WimaMeasurementArea &other) { WimaAreaData::assign(other); if (other.ready()) { this->_tileData = other.tileData(); this->_progress = other.progress(); } else { qWarning() << "WimaMeasurementAreaData::assign(): WimaMeasurementArea not ready."; } } bool operator==(const WimaMeasurementAreaData &m1, const WimaMeasurementArea &m2) { return operator==(*static_cast(&m1), *static_cast(&m2)) && m1.tileData() == m2.tileData() && m1.progress() == m2.progress(); } bool operator!=(const WimaMeasurementAreaData &m1, const WimaMeasurementArea &m2) { return !(m1 == m2); } bool operator==(const WimaMeasurementArea &m1, const WimaMeasurementAreaData &m2) { return m2 == m1; } bool operator!=(const WimaMeasurementArea &m1, const WimaMeasurementAreaData &m2) { return m2 != m1; }