-
Notifications
You must be signed in to change notification settings - Fork 1
/
actionhandler.h
104 lines (78 loc) · 3.02 KB
/
actionhandler.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
#ifndef ACTIONHANDLER_H
#define ACTIONHANDLER_H
#include <QObject>
#include "tools.h"
class MathsContainer; class H2CanvasDelegateLiftedGraph; class EquivariantHarmonicMapsFactory; class MainWindow; class Canvas;
class InputMenu; class DisplayMenu; class OutputMenu; class Canvas; class TopFactory; class QStatusBar;
enum class ActionHandlerMessage {HIGHLIGHTED_LEFT, HIGHLIGHTED_RIGHT, END_CANVAS_REPAINT, FINISHED_COMPUTING};
class ActionHandler : public QObject
{
Q_OBJECT
friend class MainApplication;
public:
ActionHandler(const ActionHandler &) = delete;
ActionHandler & operator=(const ActionHandler &) = delete;
void processMessage(ActionHandlerMessage message);
void receiveFNcoordinates(const std::vector<double> &lengths, const std::vector<double> &twists);
void discardReceiveFNcoordinates();
private slots:
void genusClicked(int choice);
void setRhoDomainClicked(int choice);
void setRhoImageClicked(int choice);
void meshDepthClicked(int choice);
void outputResetButtonClicked();
void computeButtonClicked();
void iterateButtonClicked();
void stopButtonClicked();
void resetViewButtonClicked();
void showTranslatesClicked(int choice);
//void coloringClicked(int choice);
//void colorClicked(int choice);
void coloringClickedLeft(int choice);
void colorClickedLeft(int choice);
void coloringClickedRight(int choice);
void colorClickedRight(int choice);
void flowChoiceClicked(int choice);
void finishedComputing();
public slots:
void meshCreated(uint nbMeshPoints);
void showStatusBarMessage(const QString &message, int timeout = 0);
private:
ActionHandler();
void resetBooleans();
void setWindow(MainWindow *window);
void setContainer(MathsContainer *mathsContainer);
void setFactory(TopFactory *topFactory);
void inputReset();
void resetDelegatePointers();
void connectMenusSignals();
void setRhoNiceDomain();
void setRhoNiceImage();
void errorMessageForSetRhoNice();
void setRhoRandomDomain();
void setRhoRandomImage();
void setRhoFNDomain();
void setRhoFNImage();
void resetStatusBarMessage();
void updateCanvasGraph(bool left, bool right);
static void randomFNcoordinates(uint genus, std::vector<double> &lengthsOut, std::vector<double> &twistsOut);
void setReadyToCompute();
void setDisplayMenuReady(bool left);
void dealRhoDomainReady();
void dealRhoImageReady();
bool isReadyToCompute() const;
MainWindow *window;
Canvas *leftCanvas, *rightCanvas;
H2CanvasDelegateLiftedGraph *leftDelegate, *rightDelegate;
InputMenu *inputMenu;
OutputMenu *outputMenu;
DisplayMenu *displayMenu;
QStatusBar *statusBar;
MathsContainer *mathsContainer;
TopFactory *topFactory;
bool isShowingLive;
bool showTranslatesAroundVertex, showTranslatesAroundVertices, showTranslatesAroundVerticesStar;
bool isRhoDomainSet, isRhoImageSet;
bool expectingFNdomain, expectingFNimage;
};
#endif // ACTIONHANDLER_H