-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShellGIS.cpp
More file actions
282 lines (216 loc) · 7.09 KB
/
ShellGIS.cpp
File metadata and controls
282 lines (216 loc) · 7.09 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
//----------------------------------------------------------------------------//
// *** ДВИЖОК ГЕОИНФОРМАЦИОННОЙ СИСТЕМЫ *** //
// //
// Файл ShellGIS.cpp //
// //
// *** TSHELLGIS ОБОЛОЧКА ДВИЖКА ГЕОИНФОРМАЦИОННОЙ СИСТЕМЫ *** //
// //
// Автор ГЛУЩЕНКО Сергей //
// //
// Москва //
//----------------------------------------------------------------------------//
#include "ShellGIS.h"
TShellGIS::TShellGIS(void)
{
//Подключение сигнала к сигналу, а не к слоту
connect(this, SIGNAL(GetDataLeftMouse(TGISLib::TDataLeftMouse)), this, SIGNAL(GetDataLeftMouseARROW(TGISLib::TDataLeftMouse)));
}
TShellGIS::~TShellGIS(void)
{
disconnect();
}
void TShellGIS::SetProjection(TGISLib::TProj Value)
{
TProjection Proj; //Проекция-пустышка (не установлена)
switch (Value)
{
//Цилиндрическая равнопромежуточная проекция Плате-Карре
case CYLINDRICAL:
Projection.Number = Value;
Projection.Fi0 = 0.0;
Projection.L0 = 0.0;
Projection.Map.Xmin = -180.0;
Projection.Map.Xmax = 180.0;
Projection.Map.Ymin = -90.0;
Projection.Map.Ymax = 90.0;
break;
//Азимутальная ортографическая проекция Северного Полюса
case NORTHPOLE:
Projection.Number = Value;
Projection.Fi0 = 90.0;
Projection.L0 = 0.0;
Projection.Map.Xmin = -Cartography->RZEkv;
Projection.Map.Xmax = Cartography->RZEkv;
Projection.Map.Ymin = -Cartography->RZEkv;
Projection.Map.Ymax = Cartography->RZEkv;
break;
//Азимутальная ортографическая проекция Южного Полюса
case SOUTHPOLE:
Projection.Number = Value;
Projection.Fi0 = -90.0;
Projection.L0 = 0.0;
Projection.Map.Xmin = -Cartography->RZEkv;
Projection.Map.Xmax = Cartography->RZEkv;
Projection.Map.Ymin = -Cartography->RZEkv;
Projection.Map.Ymax = Cartography->RZEkv;
break;
//Равноугольная цилиндрическая проекция Меркатора
case MERCATOR:
Projection.Number = Value;
Projection.Fi0 = 0.0;
Projection.L0 = 0.0;
Projection.Map.Xmin = -M_PI*Cartography->RZEkv;
Projection.Map.Xmax = M_PI*Cartography->RZEkv;
Projection.Map.Ymin = -M_PI*Cartography->RZEkv;
Projection.Map.Ymax = M_PI*Cartography->RZEkv;
break;
//Псевдоцилиндрическая проекция Каврайского
case KAVRAYSKIY:
Projection.Number = Value;
Projection.Fi0 = 0.0;
Projection.L0 = 0.0;
Projection.Map.Xmin = -sqrt(3.0)*M_PI/2.0;
Projection.Map.Xmax = sqrt(3.0)*M_PI/2.0;
Projection.Map.Ymin = -M_PI/2.0;
Projection.Map.Ymax = M_PI/2.0;
break;
//Проекция-пустышка
case NONEPROJECTION:
Projection.Number = Value;
Projection.Fi0 = 0.0;
Projection.L0 = 0.0;
Projection.Map.Xmin = 0.0;
Projection.Map.Xmax = 0.0;
Projection.Map.Ymin = 0.0;
Projection.Map.Ymax = 0.0;
break;
}
if (Layout == NULL)
{
Projection = Proj; //Если нет подключения к окну, тогда и проекцию не устанавливать (установить пустышку)
}
NormalizeScale(); //Нормализовать масштаб при изменении проекции
MapData->CoolRePaint();
}
void TShellGIS::ConnectWindow(QGridLayout *FLayout, QLabel *FCurCoord, QLabel* FScale, QLabel* FRuler)
{
if (Layout == NULL)
{
Layout = FLayout;
Layout->addWidget(View);
CurCoord = FCurCoord;
CurrentScale = FScale;
Ruler = FRuler;
}
}
void TShellGIS::DisconnectWindow()
{
if (Layout != NULL)
{
Layout->removeWidget(View);
View->setParent(Q_NULLPTR);
Layout = NULL;
CurCoord = NULL;
CurrentScale = NULL;
}
}
void TShellGIS::ShowAllMap()
{
NormalizeScale();
}
void TShellGIS::SetTool(TView::TTool Value)
{
SetCurrentTool(Value);
}
TView::TTool TShellGIS::GetTool()
{
return GetCurrentTool();
}
void TShellGIS::WhatIsShow(bool Frame, bool Grid15)
{
MapData->WhatIsShow(Frame, Grid15);
}
void TShellGIS::RePaint()
{
MapData->CoolRePaint();
}
TMapData::TLayerList TShellGIS::GetLayerList()
{
return MapData->GetLayerList();
}
bool TShellGIS::FindLayer(std::string Name)
{
int res1;
bool res2;
res1 = MapData->FindLayer(Name);
if (res1 == -1)
{
res2 = false;
}
else
{
res2 = true;
}
return res2;
}
bool TShellGIS::ShowLayer(std::string Name)
{
return MapData->ShowLayer(Name);
}
bool TShellGIS::HideLayer(std::string Name)
{
return MapData->HideLayer(Name);
}
bool TShellGIS::AddLayer(std::string Name)
{
return MapData->AddLayer(Name);
}
bool TShellGIS::DelLayer(std::string Name)
{
return MapData->DelLayer(Name);
}
void TShellGIS::DelAllUserLayers()
{
MapData->DelAllUserLayers();
}
bool TShellGIS::AddLayerFromMIF(std::string LayerName, std::string FilePathName)
{
return MapData->AddLayerFromMIF(LayerName, FilePathName);
}
bool TShellGIS::AddLayerDynamicPoint()
{
return MapData->AddLayerDynamicPoint();
}
unsigned int TShellGIS::GetFreeID(std::string Name)
{
return MapData->GetFreeID(Name);
}
TLayer::THeadersObjects TShellGIS::GetObjList(std::string Name)
{
return MapData->GetObjList(Name);
}
bool TShellGIS::AddInDynamicPoint(unsigned int ID, std::string Comment, TMultitude::TOnePoint Point, int ColorMI)
{
return MapData->AddInDynamicPoint(ID, Comment, Point, ColorMI);
}
void TShellGIS::MoveInDynamicPoint(unsigned int ID, std::string Comment, TMultitude::TOnePoint Point)
{
MapData->MoveInDynamicPoint(ID, Comment, Point);
}
bool TShellGIS::AddPointInLayer(std::string Name, unsigned int ID, std::string ObjName, TLayer::TTypeSymbol Type,
TMultitude::TOnePoint Point, QPen Pen, QBrush Brush)
{
return MapData->AddPointInLayer(Name, ID, ObjName, Type, Point, Pen, Brush);
}
bool TShellGIS::AddPolyLineInLayer(std::string Name, unsigned int ID, std::string ObjName, TMultitude::TSpot Spot, QPen Pen)
{
return MapData->AddPolyLineInLayer(Name, ID, ObjName, Spot, Pen);
}
bool TShellGIS::AddRegionInLayer(std::string Name, unsigned int ID, std::string ObjName, TMultitude::TSpot Spot, QPen Pen, QBrush Brush)
{
return MapData->AddRegionInLayer(Name, ID, ObjName, Spot, Pen, Brush);
}
bool TShellGIS::DelObjFromLayer(std::string Name, unsigned int ID)
{
return MapData->DelObjFromLayer(Name, ID);
}