-
Notifications
You must be signed in to change notification settings - Fork 1
/
discreteflowfactory.h
80 lines (60 loc) · 2.54 KB
/
discreteflowfactory.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
#ifndef DISCRETEFLOWFACTORY_H
#define DISCRETEFLOWFACTORY_H
#include <QThread>
#include "tools.h"
#include "grouprepresentation.h"
#include "discreteflowiterator.h"
#include "liftedgraph.h"
template <typename Point, typename Map> class LiftedGraphFunctionTriangulated; class H2DiscreteFlowFactoryThread;
template <typename Point, typename Map> class DiscreteFlowFactory
{
friend class ActionHandler;
friend class H2DiscreteFlowFactoryThread;
public:
DiscreteFlowFactory(GroupRepresentation<H2Isometry> *rhoDomain,
GroupRepresentation<H2Isometry> *rhoImage,
LiftedGraphFunctionTriangulated<H2Point, H2Isometry> *domainFunction,
LiftedGraphFunctionTriangulated<H2Point, H2Isometry> *imageFunction);
void setGenus(uint genus);
void setMeshDepth(uint meshDepth);
void setNiceRhoDomain();
void setNiceRhoImage();
void setRhoDomain(const std::vector<double> & FNlengths, const std::vector<double> FNtwists);
void setRhoImage(const std::vector<double> & FNlengths, const std::vector<double> FNtwists);
void resetRhoDomain();
void resetRhoImage();
void resetInitial();
bool isDomainFunctionInitialized(uint &nbMeshPointsOut);
double getSupError() const {return supError;}
double getEnergyError() const {return energyError;}
void updateSupError();
void updateEnergyError();
double getTolerance() const;
void setFlowChoice(int flowChoice);
void run();
void iterate(uint N);
void stopRunning();
uint getNbIterations() const {return nbIterations;}
private:
bool isReady() const;
void initializeDomainFunction();
void initializeImageFunction();
void initializeRhoDomain();
void initializeRhoImage();
void refreshImageFunction();
uint genus, meshDepth;
bool isGenusSet, isMeshDepthSet, isRhoDomainSet, isRhoImageSet;
bool stop;
std::vector<double> FNLengthsDomain, FNTwistsDomain, FNLengthsImage, FNTwistsImage;
GroupRepresentation<H2Isometry> *rhoDomain;
GroupRepresentation<Map> *rhoImage;
LiftedGraphFunctionTriangulated<H2Point, H2Isometry> *domainFunction;
std::unique_ptr<LiftedGraphFunctionTriangulated<Point, Map> > initialImageFunction;
LiftedGraphFunctionTriangulated<Point, Map> *imageFunction;
std::unique_ptr<DiscreteFlowIterator<Point, Map> > iterator;
uint nbIterations;
double minDomainEdgeLength, supError, energyError, tolerance;
int flowChoice;
H2DiscreteFlowFactoryThread *thread;
};
#endif // DISCRETEFLOWFACTORY_H