-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildingPoint.h
150 lines (131 loc) · 3.23 KB
/
BuildingPoint.h
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
138
139
140
141
142
143
144
145
146
147
148
149
#pragma once
#include "ChangeTypeTool.h"
#include <vector>
#include<algorithm>
#include <sstream>
#include <map>
using namespace std;
class BuildingPoint {
public:
int id;
double longitude;
double latitude;
double height;
//左右相邻节点考虑到了多个建筑物共点的情况
//如果不共点,vector的大小为1
/*
vector<int> leftPointId;
vector<int> leftPointMaterialId;
vector<int> rightPointId;
vector<int> rightPointMaterialId;
*/
//未定义网格的类型
int gridId;
//左右相邻节点考虑到了多个建筑物共点的情况
//如果不共点,vector的大小为1
int buildingId;
double px;
double py;
public:
//构造函数
BuildingPoint(){};
BuildingPoint(vector<string> param,string sepOut) {
vector<string>::iterator iter = param.begin();
this->setId(ChangeTypeTool::stringToInt(*iter++));
this->setLongtitude(ChangeTypeTool::stringToDouble(*iter++));
this->setLatitude(ChangeTypeTool::stringToDouble(*iter++));
this->setHeight(ChangeTypeTool::stringToDouble(*iter++));
/*
this->setLeftPointId(ChangeTypeTool::stringToIntVector(*iter++,sepOut));
this->setLeftPointMaterialId(ChangeTypeTool::stringToIntVector(*iter++,sepOut));
this->setRightPointId(ChangeTypeTool::stringToIntVector(*iter++,sepOut));
this->setRightPointMaterialId(ChangeTypeTool::stringToIntVector(*iter++,sepOut));
*/
this->setGridId(ChangeTypeTool::stringToInt(*iter++));
this->setPx(ChangeTypeTool::stringToDouble(*iter++));
this->setPy(ChangeTypeTool::stringToDouble(*iter));
}
//得到对象
static BuildingPoint getObject(vector<string> param,string sepOut);
static vector<BuildingPoint> getObjectSet(vector<vector<string>> param,string sepOut);
//set方法
void setId(int id) {
this->id = id;
}
void setLongtitude(double longitude) {
this->longitude = longitude;
}
void setLatitude(double latitude) {
this->latitude = latitude;
}
void setHeight(double height) {
this->height = height;
}
/*
void setLeftPointId(vector<int> leftPointId) {
this->leftPointId = leftPointId;
}
void setLeftPointMaterialId(vector<int> leftPointMaterialId) {
this->leftPointMaterialId = leftPointMaterialId;
}
void setRightPointId(vector<int> rightPointId) {
this->rightPointId = rightPointId;
}
void setRightPointMaterialId(vector<int> rightPointMaterialId) {
this->rightPointMaterialId = rightPointMaterialId;
}
*/
void setGridId(int gridId) {
this->gridId = gridId;
}
void setBuildingId(int buildingId) {
this->buildingId = buildingId;
}
void setPx(double px) {
this->px=px;
}
void setPy(double py) {
this->py=py;
}
//get方法
int getId() {
return this->id;
}
double getLongtitude() {
return this->longitude;
}
double getLatitude() {
return this->latitude;
}
double getHeight() {
return this->height;
}
/*
vector<int> getLeftPointId() {
return this->leftPointId;
}
vector<int> getLeftPointMaterialId() {
return this->leftPointMaterialId;
}
vector<int> getRightPointId() {
return this->rightPointId;
}
vector<int> getRightPointMaterialId() {
return this->rightPointMaterialId;
}
*/
int getGridId() {
return this->gridId;
}
//左右相邻节点考虑到了多个建筑物共点的情况
//如果不共点,vector的大小为1
int getBuildingId() {
return this->buildingId;
}
double getPx() {
return this->px;
}
double getPy() {
return this->py;
}
};