-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathStructures.h
More file actions
156 lines (134 loc) · 2.71 KB
/
Copy pathStructures.h
File metadata and controls
156 lines (134 loc) · 2.71 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
#pragma once
#include "Enumerations.h"
#include "Extent.h"
#include "TableRow.h"
struct Poly
{
public:
Poly() {}
std::vector<double> polyX;
std::vector<double> polyY;
};
struct TileBuffer
{
bool Initialized;
int Provider; // id of provider in buffer
int Zoom; // zoom at which current tile buffer was drawn
Extent Extents;
};
class TimedPoint
{
public:
int x;
int y;
DWORD time;
TimedPoint(const int x, const int y, const DWORD time) :
x(x), y(y), time(time) {}
};
// some classes as well but never mind
class ZoombarParts
{
public:
CRect PlusButton;
CRect MinusButton;
CRect Handle;
CRect Bar;
ZoombarParts() :
PlusButton(0, 0, 0, 0), MinusButton(0, 0, 0, 0), Handle(0, 0, 0, 0), Bar(0, 0, 0, 0) { }
double GetRelativeZoomFromClick(const int y)
{
double val = (y - Bar.top) / static_cast<double>(Bar.bottom - Bar.top);
if (val < 0.0) val = 0.0;
if (val > 1.0) val = 1.0;
return 1 - val;
}
};
struct MeasurePoint
{
PointPart Part;
Point2D Proj;
double x; // in decimal degrees
double y;
void CopyTo(MeasurePoint& pnt2) {
pnt2.x = x;
pnt2.y = y;
pnt2.Proj = Proj;
}
MeasurePoint() : Part(PartNone) {}
};
struct OgrUpdateError
{
int ShapeIndex;
CStringW ErrorMsg;
OgrUpdateError(const int shapeIndex, const CStringW msg) : ShapeIndex(shapeIndex), ErrorMsg(msg) {}
};
struct ShapeRecordData
{
VARIANT Shape;
TableRow* Row;
ShapeRecordData()
{
this->Row = new TableRow();
VariantInit(&Shape);
}
~ShapeRecordData()
{
VariantClear(&Shape);
delete Row;
}
};
struct CategoriesData
{
public:
CComVariant minValue;
CComVariant maxValue;
CStringW expression;
CStringW name;
tkCategoryValue valueType;
int classificationField;
bool skip;
};
struct LayerShape
{
long LayerHandle;
long ShapeIndex;
LayerShape() : LayerHandle(-1), ShapeIndex(-1) {}
LayerShape(const long layerHandle, const long shapeIndex) : LayerHandle(layerHandle), ShapeIndex(shapeIndex) {}
bool IsEmpty() {
return LayerHandle == -1 || ShapeIndex == -1;
}
};
struct CallbackParams
{
ICallback* cBack;
const char* sMsg;
CallbackParams() : cBack(nullptr), sMsg(nullptr) {}
CallbackParams(const char* message);
CallbackParams(ICallback* localCallback, const char* message);
};
struct ImageSpecs
{
double dx;
double dy;
double xllCorner;
double yllCorner;
int width;
int height;
double GetXtrCorner() {
return xllCorner + static_cast<double>(width) * dx;
}
double GetYtrCorner() {
return yllCorner + static_cast<double>(height) * dy;
}
};
struct pointEx
{
pointEx() {}
pointEx(double& x, double& y)
{
X = x;
Y = y;
}
double X;
double Y;
};