forked from therion/therion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thdb2dprj.h
134 lines (92 loc) · 2.97 KB
/
thdb2dprj.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
/**
* @file thdb2dprj.h
* 2D projection.
*/
/* Copyright (C) 2000 Stacho Mudrak
*
* $Date: $
* $RCSfile: $
* $Revision: $
*
* --------------------------------------------------------------------
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* --------------------------------------------------------------------
*/
#ifndef thdb2dprj_h
#define thdb2dprj_h
#include "thparse.h"
#include "thmapstat.h"
#include <map>
#include <list>
/**
* Projection types.
*/
enum {
TT_2DPROJ_UNKNOWN = -1, ///< ???
TT_2DPROJ_NONE = 0, ///< None projection, for sections.
TT_2DPROJ_PLAN = 1, ///< Basic plan projection
TT_2DPROJ_ELEV = 2, ///< Elevation
TT_2DPROJ_EXTEND = 3, ///< Extended elevation
};
/**
* Projection parsing table.
*/
static const thstok thtt_2dproj[] = {
{"elevation", TT_2DPROJ_ELEV},
{"extended", TT_2DPROJ_EXTEND},
{"none", TT_2DPROJ_NONE},
{"plan", TT_2DPROJ_PLAN},
{NULL, TT_2DPROJ_UNKNOWN}
};
/**
* 2D projection class.
*/
class thdb2dprj {
public:
char type; ///< Projection type.
int id; ///< ID.
const char * index; ///< Projection index.
double pp1, ///< Projection parameter 1.
amaxdist;
bool processed; ///< Check whether projection is processed.
class thscrap * first_scrap, ///< First scrap in projection.
* last_scrap; ///< Last scrap in projection.
class thjoin * first_join, ///< Joins in given projection.
* last_join; ///< Joins in given projection.
class thdb2dji * first_join_list = nullptr, ///< 1. Join list.
* last_join_list = nullptr; ///< Last join list.
double shift_x, shift_y, shift_z, rshift_x = 0.0, rshift_y = 0.0, rshift_z = 0.0; ///< Shift + reverse shift.
thmapstat stat;
/**
* Standard constructor.
*/
thdb2dprj();
/**
* Constructor with arguments.
*/
thdb2dprj(char, char *);
};
class thdb2dprjid {
public:
char type; ///< Projection type.
const char * index; ///< Projection index.
thdb2dprjid(); ///< Default constructor.
thdb2dprjid(thdb2dprj * proj); ///< Constructor from projection.
thdb2dprjid(int tt, const char * ii) : type(tt), index(ii) {} ///< ???
};
bool operator < (const thdb2dprjid & p1, const thdb2dprjid & p2);
typedef std::list <thdb2dprj> thdb2dprj_list;
typedef std::map <thdb2dprjid, thdb2dprj *> thdb2dprjid_map;
#endif