-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwindow.h
184 lines (156 loc) · 4.86 KB
/
window.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// (c) 2015 David Vyvlečka, AGPLv3
#ifndef WINDOW_H
#define WINDOW_H
#include <QtWidgets>
#include <QWidget>
#include <QSlider>
#include "admeshcontroller.h"
#include "propertiesdialog.h"
namespace Ui {
class Window;
}
/*!
* \brief Main application window.
*
* Contains main rendering widget, menu, buttons layout.
*/
class Window : public QWidget
{
Q_OBJECT
public:
/*!
* \brief Constructor.
*/
explicit Window(QWidget *parent = 0);
/*!
* \brief Destructor.
*/
~Window();
public slots:
/*!
* \brief Sends command to controller to open file.
* \param filename Filename given.
*/
void openByFilename(const char* filename);
/*!
* \brief Sets solid mode.
*/
void setSolid();
/*!
* \brief Sets wireframe mode.
*/
void setWireframe();
/*!
* \brief Sets solid mode with thick edges.
*/
void setSolidWithEdges();
/*!
* \brief Toggle color scheme. Light and dark scheme supported.
*/
void toggleColorScheme();
/*!
* \brief Set selected color scheme.
*/
void setColorScheme();
/*!
* \brief Toggle inverted mouse.
*/
void toggleMouseInvert();
/*!
* \brief Initialize and exec properties dialog.
*/
void initProperties();
/*!
* \brief Enable/disable Undo based on value.
* \param val given value
*/
void allowUndo(bool val);
/*!
* \brief Enable/disable Redo based on value.
* \param val given value
*/
void allowRedo(bool val);
/*!
* \brief Enable/disable Save based on value.
* \param val given value
*/
void allowSave(bool val);
/*!
* \brief Enable/disable Save as based on value.
* \param val given value
*/
void allowSaveAs(bool val);
/*!
* \brief Enable/disable Export based on value.
* \param val given value
*/
void allowExport(bool val);
/*!
* \brief Enable/disable Close based on value.
* \param val given value
*/
void allowClose(bool val);
protected:
/*!
* \brief Reimplemented method. Handles key press.
*/
void keyPressEvent(QKeyEvent *event);
/*!
* \brief Reimplemented method. Handles key release.
*/
void keyReleaseEvent(QKeyEvent *event);
/*!
* \brief Reimplemented method. Handles closed window (application exit).
*/
void closeEvent(QCloseEvent *event);
void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
admeshController *controller; ///< Main ADMeshController
private:
/*!
* \brief Write settings to config.
*/
void writeSettings();
/*!
* \brief Read settings from config.
*/
void readSettings();
int scheme; ///< Color scheme selected;
Ui::Window *ui; ///< Holds user interface.
void addActions(); ///< Creates menu actions.
void addMenus(); ///< Creates menu.
void addToolbars(); ///< Creates toolbar.
QMenu *fileMenu; ///< File menu.
QMenu *editMenu; ///< Editation menu.
QMenu *viewMenu; ///< View menu.
QAction *openAct; ///< Open file action.
QAction *saveAct; ///< Save file action.
QAction *saveAsAct; ///< Save as file action.
QAction *exportAct; ///< Export file action.
QAction *closeAct; ///< Close selected objects.
QAction *quitAct; ///< Quit application.
QAction *axesAct; ///< Show axes action.
QAction *gridAct; ///< Show grid action.
QAction *solidAct; ///< Solid mode on.
QAction *wireframeAct; ///< Wireframe mode on.
QAction *solidwithedgesAct; ///< Solid mode with edges on.
QAction *infoAct; ///< Show/hide mesh info.
QAction *frontAct; ///< Set front view.
QAction *backAct; ///< Set back view.
QAction *leftAct; ///< Set left view.
QAction *rightAct; ///< Set right view.
QAction *topAct; ///< Set top view.
QAction *bottomAct; ///< Set bottom view.
QAction *centerAct; ///< Reset view to center.
QAction *selectAllAct; ///< Select all objects.
QAction *selectInverseAct; ///< Select inverse.
QAction *undoAct; ///< Undo.
QAction *redoAct; ///< Redo.
QAction *propertiesAct; ///< Properties dialog.
QToolButton* openButton; ///< Open file button.
QToolButton* saveButton; ///< Save file button.
QToolButton* undoButton; ///< Undo button.
QToolButton* redoButton; ///< Redo button.
QToolButton* closeButton; ///< Close file button.
};
#endif // WINDOW_H