-
Notifications
You must be signed in to change notification settings - Fork 1
/
h2meshpoint.h
116 lines (91 loc) · 4.03 KB
/
h2meshpoint.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
#ifndef H2MESHPOINT_H
#define H2MESHPOINT_H
#include "tools.h"
#include "h2isometry.h"
#include "word.h"
template <typename Point, typename Map> class LiftedGraphFunctionTriangulated;
class H2MeshPoint
{
friend class H2Mesh;
friend class H2MeshConstructor;
friend class H2MeshFunction;
friend class H2MeshFunctionIterator;
friend class LiftedGraphFunctionTriangulated<H2Point, H2Isometry>;
public:
H2MeshPoint() = delete;
virtual ~H2MeshPoint() {}
protected:
virtual bool isCutPoint() const {return false;}
virtual bool isBoundaryPoint() const {return false;}
virtual bool isVertexPoint() const {return false;}
virtual bool isSteinerPoint() const {return false;}
bool isInteriorPoint() const {return !(isBoundaryPoint() || isVertexPoint() || isSteinerPoint());}
H2MeshPoint(uint subdivisionIndex, uint indexInSubdivision, uint index) : subdivisionIndex(subdivisionIndex), indexInSubdivision(indexInSubdivision), index(index) {}
uint subdivisionIndex, indexInSubdivision;
std::vector<uint> neighborsIndices;
std::vector<double> neighborsWeightsEnergy,neighborsWeightsCentroid;
uint index;
};
class H2MeshCutPoint : public H2MeshPoint
{
friend class H2Mesh;
friend class H2MeshConstructor;
friend class LiftedGraphFunctionTriangulated<H2Point, H2Isometry>;
private:
H2MeshCutPoint(uint subdivisionIndexLeft, uint indexInSubdivisionLeft, uint subdivisionIndexRight, uint indexInSubdivisionRight, uint index) :
H2MeshPoint(subdivisionIndexLeft, indexInSubdivisionLeft, index),
subdivisionIndexRight(subdivisionIndexRight), indexInSubdivisionRight(indexInSubdivisionRight) {}
bool isCutPoint() const override final {return true;}
uint subdivisionIndexRight, indexInSubdivisionRight;
};
class H2MeshBoundaryPoint : public H2MeshPoint
{
friend class H2Mesh;
friend class H2MeshConstructor;
friend class H2MeshFunctionIterator;
friend class H2MeshFunction;
friend class LiftedGraphFunctionTriangulated<H2Point, H2Isometry>;
private:
H2MeshBoundaryPoint(uint subdivisionIndex, uint indexInSubdivision, uint side, uint index) :
H2MeshPoint(subdivisionIndex, indexInSubdivision, index), side(side) {}
bool isBoundaryPoint() const override final {return true;}
uint side;
uint partnerPointIndex;
std::vector<Word> neighborsPairings;
};
class H2MeshVertexPoint : public H2MeshPoint
{
friend class H2Mesh;
friend class H2MeshConstructor;
friend class H2MeshFunctionIterator;
friend class H2MeshFunction;
friend class LiftedGraphFunctionTriangulated<H2Point, H2Isometry>;
private:
H2MeshVertexPoint(uint subdivisionIndex, uint indexInSubdivision, uint vertexIndex,
std::vector<uint> subdivisionIndices, std::vector<uint> indicesInSubdivisions, uint index) :
H2MeshPoint(subdivisionIndex, indexInSubdivision, index), vertexIndex(vertexIndex),
subdivisionIndices(subdivisionIndices), indicesInSubdivisions(indicesInSubdivisions) {}
bool isVertexPoint() const override final {return true;}
uint vertexIndex;
std::vector<Word> neighborsPairings;
std::vector<uint> subdivisionIndices, indicesInSubdivisions;
};
class H2MeshSteinerPoint : public H2MeshPoint
{
friend class H2Mesh;
friend class H2MeshConstructor;
friend class H2MeshFunctionIterator;
friend class H2MeshFunction;
friend class LiftedGraphFunctionTriangulated<H2Point, H2Isometry>;
private:
H2MeshSteinerPoint(uint subdivisionIndex, uint indexInSubdivision, uint side,
std::vector<uint> subdivisionIndices, std::vector<uint> indicesInSubdivisions, uint index) :
H2MeshPoint(subdivisionIndex, indexInSubdivision, index), side(side),
subdivisionIndices(subdivisionIndices), indicesInSubdivisions(indicesInSubdivisions) {}
bool isSteinerPoint() const override final {return true;}
uint side;
uint partnerPointIndex;
std::vector<Word> neighborsPairings;
std::vector<uint> subdivisionIndices, indicesInSubdivisions;
};
#endif // H2MESHPOINT_H