-
Notifications
You must be signed in to change notification settings - Fork 1
/
liftedgraph.h
136 lines (101 loc) · 5.19 KB
/
liftedgraph.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
#ifndef LIFTEDGRAPH_H
#define LIFTEDGRAPH_H
#include "tools.h"
#include "discretegroup.h"
#include "grouprepresentation.h"
#include "triangularsubdivision.h"
#include "h2isometry.h"
#include "h2polygontriangulater.h"
class Word;
template <typename Point, typename Map> class DiscreteFlowIterator;
class LiftedGraph
{
friend class DiscreteFlowIterator<H2Point, H2Isometry>;
public:
LiftedGraph() {}
std::unique_ptr<LiftedGraph> cloneCopyConstruct() const;
void cloneCopyAssign(const LiftedGraph *other);
virtual ~LiftedGraph() {}
uint getNbPoints() const;
uint getNbBoundaryPoints() const;
bool isBoundaryPoint(uint index) const;
protected:
LiftedGraph(const LiftedGraph &other);
LiftedGraph & operator=(LiftedGraph);
virtual LiftedGraph *cloneCopyConstructImpl() const;
virtual void cloneCopyAssignImpl(const LiftedGraph *other);
DiscreteGroup Gamma;
uint nbBoundaryPoints, nbPoints;
std::vector< std::vector<uint> > neighborsIndices;
std::vector< std::vector<double> > neighborsWeightsCentroid,neighborsWeightsEnergy;
std::vector< std::vector<Word> > boundaryPointsNeighborsPairings;
std::vector< std::vector<uint> > boundaryPointsPartnersIndices;
};
template <typename Point, typename Map> class LiftedGraphFunction : public LiftedGraph
{
friend class DiscreteFlowIterator<H2Point, H2Isometry>;
public:
LiftedGraphFunction() {}
LiftedGraphFunction<Point, Map> & operator=(LiftedGraphFunction<Point, Map>) = delete;
std::unique_ptr<LiftedGraphFunction<Point, Map> > cloneCopyConstruct() const;
void cloneCopyAssign(const LiftedGraphFunction<Point, Map> *other);
virtual ~LiftedGraphFunction() {}
GroupRepresentation<Map> getRepresentation() const;
Point getValue(uint index) const;
std::vector<Point> getValues() const;
std::vector<Point> getNeighborsValues(uint index) const;
std::vector<Point> getNeighborsValuesKicked(uint index) const;
std::vector<Point> getPartnersValues(uint index) const;
protected:
LiftedGraphFunction(const LiftedGraphFunction &other);
virtual LiftedGraph *cloneCopyConstructImpl() const override;
virtual void cloneCopyAssignImpl(const LiftedGraph *other) override;
void refreshBoundaryPointsNeighborsPairingsValues();
virtual void resetValues(const std::vector<Point> &newValues);
GroupRepresentation<Map> rho;
std::vector< std::vector<Map> > boundaryPointsNeighborsPairingsValues;
std::vector<Point> values;
};
class H2Mesh; class TriangulationTriangle; class H2Point;
template <typename Point, typename Map> class LiftedGraphFunctionTriangulated : public LiftedGraphFunction<Point, Map>
{
friend class MathsContainer;
friend class FenchelNielsenUser;
private:
public:
LiftedGraphFunctionTriangulated(const LiftedGraphFunctionTriangulated<Point, Map> &other);
LiftedGraphFunctionTriangulated<Point, Map> & operator=(LiftedGraphFunctionTriangulated<Point, Map>) = delete;
std::unique_ptr< LiftedGraphFunctionTriangulated<Point, Map> > cloneCopyConstruct() const;
void cloneCopyAssign(const LiftedGraphFunctionTriangulated<Point, Map> *other);
std::vector<Point> getBoundary() const;
std::vector< std::vector<Point> > getTrianglesUp() const;
std::vector< std::vector<Point> > getAllTriangles() const;
std::vector<uint> getSteinerWeights() const;
std::vector<Point> getFirstVertexOrbit() const;
double getMinEdgeLengthForRegularTriangulation() const;
LiftedGraphFunctionTriangulated(const LiftedGraphFunctionTriangulated<H2Point, H2Isometry> &domainFunction, const GroupRepresentation<Map> &rhoImage, bool initializePL = true);
LiftedGraphFunctionTriangulated(const GroupRepresentation<H2Isometry> &rhoDomain, const GroupRepresentation<Map> &rhoImage, uint depth);
// Specialization to Point = H2Point, Map = H2Isometry
LiftedGraphFunctionTriangulated(const GroupRepresentation<H2Isometry> &rhoDomain, uint depth);
std::vector<H2Triangle> getH2TrianglesUp() const;
std::vector<H2Triangle> getAllH2Triangles() const;
bool triangleContaining(const H2Point &point, H2Triangle &triangleOut, uint &index1Out, uint &index2Out, uint &index3Out) const;
H2Triangle getH2Triangle(uint index1, uint index2, uint index3) const;
private:
LiftedGraphFunctionTriangulated() {}
virtual LiftedGraph *cloneCopyConstructImpl() const override;
virtual void cloneCopyAssignImpl(const LiftedGraph *other) override;
void constructUninitialized(const LiftedGraphFunctionTriangulated<H2Point, H2Isometry> &domainFunction, const GroupRepresentation<Map> &rhoImage);
void initializePiecewiseLinear(const std::vector<Point> &polygonVerticesValues);
void refreshValuesFromSubdivisions();
void refreshSubdivisionsFromValues();
virtual void resetValues(const std::vector<Point> &newValues) override;
// Specialization to Point = H2Point, Map = H2Isometry
void constructFromH2Mesh(const H2Mesh &mesh);
void rearrangeOrderForConstructFromH2Mesh(std::vector<uint> newIndices);
uint depth;
std::vector< TriangularSubdivision<Point> > subdivisions;
std::vector< std::vector<uint> > subdivisionsPointsIndicesInValues;
std::vector<TriangulationTriangle> triangles;
};
#endif // LIFTEDGRAPH_H