-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfenchelnielsenuser.h
108 lines (76 loc) · 2.21 KB
/
fenchelnielsenuser.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
#ifndef FENCHELNIELSENUSER_H
#define FENCHELNIELSENUSER_H
#include <QWidget>
#include <QGroupBox>
#include "liftedgraph.h"
class ActionHandler; class QLabel; class QDoubleSpinBox; class QPushButton; class QGridLayout; class Canvas;
class FNselector; class FNmenu; class H2CanvasDelegateLiftedGraph;
class FenchelNielsenUser : public QWidget
{
Q_OBJECT
friend class ActionHandler;
public:
FenchelNielsenUser(ActionHandler *handler, uint genus);
FenchelNielsenUser() = delete;
FenchelNielsenUser(const FenchelNielsenUser &) = delete;
FenchelNielsenUser & operator=(FenchelNielsenUser) = delete;
void showEvent(QShowEvent *);
public slots:
void saveCoordinates();
void discard();
void refresh();
void closeEvent(QCloseEvent *);
private:
void createWindow();
void createDelegatePointers();
int canvasMinimumSize() const;
QSize optimalSize() const;
ActionHandler *handler;
QGridLayout* layout;
FNselector* selector;
QLabel* infoLabel;
FNmenu* menu;
Canvas *canvas;
H2CanvasDelegateLiftedGraph *delegate;
int vertSpace;
bool saveFNcoordinates;
uint nbLengths;
GroupRepresentation<H2Isometry> rho;
LiftedGraphFunctionTriangulated<H2Point, H2Isometry> graph;
};
class FNselector : public QGroupBox
{
Q_OBJECT
friend class FenchelNielsenUser;
public:
void getFNcoordinates(std::vector<double> &lengthsOut, std::vector<double> &twistsOut) const;
private:
FNselector(FenchelNielsenUser *user, uint nbLengths);
void createLayout();
void createButtons();
void resetRhos();
FenchelNielsenUser* user;
QGridLayout* layout;
std::vector<QLabel*> lengthsLabels, twistsLabels;
std::vector<QDoubleSpinBox*> lengthsBoxes, twistsBoxes;
uint nbLengths;
int vertSpace;
int buttonHeight;
};
class FNmenu : public QGroupBox
{
Q_OBJECT
friend class FenchelNielsenUser;
public:
private:
FNmenu(FenchelNielsenUser *user);
void createLayout();
void createButtons();
QGridLayout* layout;
QPushButton *setButton, *discardButton;
QLabel *questionLabel;
FenchelNielsenUser *user;
int vertSpace;
int buttonHeight, buttonMaxWidth;
};
#endif // FENCHELNIELSENUSER_H