WimaMeasurementAreaData.cc 2.29 KB
Newer Older
1
#include "WimaMeasurementAreaData.h"
2
#include "SnakeTile.h"
3 4 5 6

const char *WimaMeasurementAreaData::typeString = "WimaMeasurementAreaData";

WimaMeasurementAreaData::WimaMeasurementAreaData(QObject *parent)
7
    : WimaAreaData(parent) {}
8

9 10 11 12
WimaMeasurementAreaData::WimaMeasurementAreaData(
    const WimaMeasurementAreaData &other, QObject *parent)
    : WimaAreaData(parent) {
  *this = other;
13 14
}

15 16 17 18
WimaMeasurementAreaData::WimaMeasurementAreaData(
    const WimaMeasurementArea &other, QObject *parent)
    : WimaAreaData(parent) {
  *this = other;
19 20 21 22 23 24 25
}

/*!
 * \overload operator=();
 *
 * Assigns \a other to the invoking object.
 */
26 27 28
WimaMeasurementAreaData &WimaMeasurementAreaData::
operator=(const WimaMeasurementAreaData &other) {
  assign(other);
29

30
  return *this;
31 32 33 34 35 36 37
}

/*!
 * \overload operator=();
 *
 * Assigns \a other to the invoking object.
 */
38 39 40
WimaMeasurementAreaData &WimaMeasurementAreaData::
operator=(const WimaMeasurementArea &other) {
  assign(other);
41

42
  return *this;
43 44
}

45 46
QString WimaMeasurementAreaData::type() const { return this->typeString; }

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
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 {
64
  return this->_tileData;
65 66
}

67
TileData &WimaMeasurementAreaData::tileData() { return this->_tileData; }
68 69 70 71 72 73 74

const QVector<int> &WimaMeasurementAreaData::progress() const {
  return this->_progress;
}

QVector<int> &WimaMeasurementAreaData::progress() { return this->_progress; }

75 76
void WimaMeasurementAreaData::assign(const WimaMeasurementAreaData &other) {
  WimaAreaData::assign(other);
77 78
  this->_tileData = other._tileData;
  this->_progress = other._progress;
79 80
}

81 82 83
void WimaMeasurementAreaData::assign(const WimaMeasurementArea &other) {
  WimaAreaData::assign(other);
  if (other.ready()) {
84 85
    this->_tileData = other.tileData();
    qWarning() << "WimaMeasurementAreaData: add progress copy here.";
86 87 88 89
  } else {
    qWarning()
        << "WimaMeasurementAreaData::assign(): WimaMeasurementArea not ready.";
  }
90
}