-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtypes.h
235 lines (175 loc) · 4.82 KB
/
types.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
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
#ifndef TYPES_H
#define TYPES_H
#include <set>
#include "qdcel/qsurface.h"
#include "qdcel/qoperators.h"
#include "dcel/surface.h"
#include "dcel/operators.h"
class myVertexAttributes;
class myFaceAttributes;
class myEdgeAttributes;
class myHalfedgeAttributes;
class myQVertexAttributes;
class myQFaceAttributes;
class myQEdgeAttributes;
class myQHalfedgeAttributes;
typedef qdcel::QSurface<myQVertexAttributes,myQFaceAttributes,myQEdgeAttributes,myQHalfedgeAttributes> QMesh;
typedef qdcel::QOperators<myQVertexAttributes,myQFaceAttributes,myQEdgeAttributes,myQHalfedgeAttributes> QOperators;
typedef QMesh::QHalfedge QHalfedge;
typedef QMesh::QEdge QEdge;
typedef QMesh::QVertex QVertex;
typedef QMesh::QFace QFace;
typedef dcel::Surface<myVertexAttributes,myFaceAttributes,myEdgeAttributes,myHalfedgeAttributes> TMesh;
typedef dcel::Operators<myVertexAttributes,myFaceAttributes,myEdgeAttributes,myHalfedgeAttributes> TOperators;
typedef TMesh::Halfedge Halfedge;
typedef TMesh::Edge Edge;
typedef TMesh::Vertex Vertex;
typedef TMesh::Face Face;
class myVertexAttributes {
public:
int id;
bool status, cl;
double distance;
int tempInt;
double tempDouble;
int getId(){
return id;
}
void setId(int newId){
this->id = newId;
}
// Needed by adg_from_dcel.hpp
bool alive(){
return this->status;
}
void set_alive(bool a){
this->status = a;
}
bool close(){
return this->cl;
}
void set_close(bool a){
this->cl = a;
}
double dist(){
return this->distance;
}
void set_dist(double d){
this->distance = d;
}
};
class myFaceAttributes {
public:
int id;
bool status;
std::set< QFace* > region;
void activate(){
this->status = true;
}
void deactivate(){
this->status = false;
}
bool is_active(){
return this->status;
}
};
class myEdgeAttributes {
public:
int id;
};
class myHalfedgeAttributes {
public:
int id;
};
#include "myAdgGeodesics.h"
typedef myApproxGeodesics geodesics;
// Attributes of the QVertex
class myQVertexAttributes {
private:
int id;
geodesics::GP* gPoint;
public:
myQVertexAttributes() {
id = -1;
gPoint = 0;
}
int getId(){
return id;
}
void setId(int newId){
this->id = newId;
}
// Pointer to the correspondent vertex of the Triangle Mesh
void setGP(geodesics::GP* v){
gPoint = v;
}
geodesics::GP* getGP(){
return gPoint;
}
};
class myQFaceAttributes {
public:
enum OrientationCut {
// Taking the qf->get_halfedge() as reference
TEMPLATE_NNNN = 0000, // Template 0 - No subdivisions
TEMPLATE_NNND = 0001, // Template 1 - Invalid
TEMPLATE_NNDN = 0010, // Tempalte 1 - Invalid
TEMPLATE_NNDD = 0011, // Template 3 - Top Right Subdivisions
TEMPLATE_NDNN = 0100, // Template 1 - Invalid
TEMPLATE_NDND = 0101, // Template 2 - Top Down Subdivisions
TEMPLATE_NDDN = 0110, // Template 3 - Bottom Right Subdivisions
TEMPLATE_NDDD = 0111, // Template 5 - Invalid
TEMPLATE_DNNN = 1000, // Template 1 - Invalid
TEMPLATE_DNND = 1001, // Template 3 - Left Top Subdivisions
TEMPLATE_DNDN = 1010, // Template 2 - Left Right Subdivisions
TEMPLATE_DNDD = 1011, // Template 5 - Invalid
TEMPLATE_DDNN = 1100, // Template 3 - Left Bottom Subdivisions
TEMPLATE_DDND = 1101, // Template 5 - Invalid
TEMPLATE_DDDN = 1110, // Template 5 - Invalid
TEMPLATE_DDDD = 1111 // Template 4 - Cross Subdivisions
};
int id;
bool subdivide, border;
OrientationCut orientation;
std::set< Face* > faces;
myQFaceAttributes(){
subdivide = false;
border = false;
orientation = TEMPLATE_NNNN;
}
int getTemplateType(){
switch(orientation){
case TEMPLATE_NNNN: return 0;
case TEMPLATE_NNND: return 1;
case TEMPLATE_NNDN: return 1;
case TEMPLATE_NNDD: return 3;
case TEMPLATE_NDNN: return 1;
case TEMPLATE_NDND: return 2;
case TEMPLATE_NDDN: return 3;
case TEMPLATE_NDDD: return 5;
case TEMPLATE_DNNN: return 1;
case TEMPLATE_DNND: return 3;
case TEMPLATE_DNDN: return 2;
case TEMPLATE_DNDD: return 5;
case TEMPLATE_DDNN: return 3;
case TEMPLATE_DDND: return 5;
case TEMPLATE_DDDN: return 5;
case TEMPLATE_DDDD: return 4;
}
}
};
class myQEdgeAttributes {
public:
int id;
bool subdivide;
bool checkEdge;
std::list< Vertex* > geoline;
myQEdgeAttributes(){
subdivide = false;
}
};
class myQHalfedgeAttributes {
public:
int id;
};
#endif