-
Notifications
You must be signed in to change notification settings - Fork 1
/
Building.cpp
138 lines (106 loc) · 2.58 KB
/
Building.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* File: Building.cpp
* Author: saikrishna
*
* Created on January 24, 2014, 9:29 PM
*/
#include <QHash>
#include "BuildingPrivate.h"
#include "Building.h"
Building::Building() :
d(new BuildingPrivate)
{
}
Building::Building(const Building& other) :
d(other.d)
{
}
uint Building::id() const {
return d->id;
}
int Building::version() const {
return d->version;
}
int Building::year() const {
return d->year;
}
QString Building::featureID() const {
return d->featureID;
}
QSharedPointer<geos::geom::Polygon> Building::building() const {
return d->building;
}
QList<uint> Building::nodeIndices() const {
return d->nodeIndices;
}
QMap<QString, QString> Building::tags() const {
return d->tags;
}
QString Building::user() const {
return d->user;
}
uint Building::uid() const {
return d->uid;
}
uint Building::changesetID() const {
return d->changesetID;
}
QDateTime Building::timestamp() const {
return d->timestamp;
}
Building::AddressMergeLevel Building::mergeLevel() const {
return d->mergeLevel;
}
void Building::setId(uint id) {
d->id = id;
}
void Building::setVersion(int version) {
d->version = version;
}
void Building::setYear(int year) {
d->year = year;
}
void Building::setFeatureID(QString featureID) {
d->featureID = featureID;
}
void Building::setBuilding(QSharedPointer<geos::geom::Polygon> building) {
d->building = building;
}
void Building::setNodeIndices(QList<uint> nodeIndices) {
d->nodeIndices = nodeIndices;
}
void Building::setTags(QMap<QString, QString> tags) {
d->tags = tags;
}
void Building::setUser(QString user) {
d->user = user;
}
void Building::setUid(uint uid) {
d->uid = uid;
}
void Building::setChangesetID(uint changesetID) {
d->changesetID = changesetID;
}
void Building::setTimestamp(QDateTime timestamp) {
d->timestamp = timestamp;
}
void Building::setMergeLevel(AddressMergeLevel mergeLevel) {
d->mergeLevel = mergeLevel;
}
Building& Building::operator=(const Building& other) {
d = other.d;
return *this;
}
uint qHash(const Building& key) {
return qHash(key.id()) ^ qHash(key.featureID()) ^ qHash(key.year());
}
bool operator==(const Building& building1, const Building& building2) {
return building1.id() == building2.id()
&& building1.featureID() == building2.featureID()
&& building1.year() == building2.year()
&& building1.building() == building2.building()
&& building1.nodeIndices() == building2.nodeIndices()
&& building1.tags() == building2.tags();
}
Building::~Building() {
}