-
Notifications
You must be signed in to change notification settings - Fork 10
/
MainWindow.h
180 lines (139 loc) · 3.8 KB
/
MainWindow.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
#ifndef __MAIN_WINDOW_H__
#define __MAIN_WINDOW_H__
#include <QMenu>
#include <QWidget>
#include <QAction>
#include <QToolBar>
#include <QSettings>
#include <QMainWindow>
#include <QSpinBox>
#include "ProjectWidget.h"
#include "LayersWidget.h"
#include "NewGridDialog.h"
#include "PaletteWidget.h"
#include "GLModelWidget.h"
#include "SproxelProject.h"
#define SPROXEL_VERSION "0.61"
#define BASE_WINDOW_TITLE (tr("Sproxel " SPROXEL_VERSION))
class Importer;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(const QString& initialFilename, QWidget* parent=NULL);
QSettings& appSettings() { return m_appSettings; }
SproxelProjectPtr project() { return m_project; }
UndoManager* undoManager() { return &m_undoManager; }
protected:
void closeEvent(QCloseEvent* event);
void keyPressEvent(QKeyEvent* event);
private:
QSettings m_appSettings;
SproxelProjectPtr m_project;
UndoManager m_undoManager;
GLModelWidget* m_glModelWidget;
// Menus
QMenu* m_menuFile;
QMenu* m_menuEdit;
QMenu* m_menuGrid;
QMenu* m_menuView;
QMenu* m_menuWindow;
// Docking windows and toolbars
QToolBar* m_toolbar;
QDockWidget* m_paletteDocker;
PaletteWidget* m_paletteWidget;
QDockWidget* m_projectDocker;
ProjectWidget* m_projectWidget;
//QDockWidget* m_layersDocker;
//LayersWidget* m_layersWidget;
QSpinBox *m_minSliceBox;
QSpinBox *m_maxSliceBox;
// Actions
QAction* m_actQuit;
QAction* m_actUndo;
QAction* m_actRedo;
QAction* m_actShiftUp;
QAction* m_actShiftDown;
QAction* m_actShiftWrap;
QAction* m_actRotateCw;
QAction* m_actRotateCcw;
QAction* m_actMirror;
QAction* m_actPreferences;
QAction* m_actExtendUp;
QAction* m_actExtendDown;
QAction* m_actContractUp;
QAction* m_actContractDown;
QAction* m_actUpRes;
QAction* m_actDownRes;
QAction* m_actViewGrid;
QAction* m_actViewVoxgrid;
QAction* m_actViewBBox;
QAction* m_actFileNew;
QAction* m_actFileOpen;
QAction* m_actFileSave;
QAction* m_actFileSaveAs;
QAction* m_actFileImport;
QAction* m_actFileExportGrid;
QActionGroup* m_toolbarActionGroup;
QAction* m_actToolSplat;
QAction* m_actToolReplace;
QAction* m_actToolDropper;
QAction* m_actToolFlood;
QAction* m_actToolEraser;
QAction* m_actToolSlab;
QAction* m_actToolLine;
QAction* m_actToolBox;
QAction* m_actToolExtrude;
QAction* m_actToolRay;
QAction *m_actAxisX;
QAction *m_actAxisY;
QAction *m_actAxisZ;
// Locals
QString m_activeFilename;
// Functions
int fileModifiedDialog();
public slots:
void newGrid();
void saveFile();
void saveFileAs();
void openFile();
void openFile(QString);
void import();
void import(Importer* activeImporter, QString filename);
void exportGrid();
void shiftUp();
void shiftDown();
void rotateCw();
void rotateCcw();
void mirror();
void extendContractShift(int axis, int incr, int shift);
void extendUp();
void extendDown();
void extendLeft();
void extendRight();
void extendFront();
void extendBack();
void contractUp();
void contractDown();
void contractLeft();
void contractRight();
void contractFront();
void contractBack();
void upRes();
void downRes();
void editPreferences();
void setToolSplat(bool stat);
void setToolFlood(bool stat);
void setToolRay(bool stat);
void setToolDropper(bool stat);
void setToolEraser(bool stat);
void setToolReplace(bool stat);
void setToolSlab(bool stat);
void setToolLine(bool stat);
void setToolBox(bool stat);
void setToolExtrude(bool stat);
void reactToModified(bool value);
void updateSlice(int mino, int maxo, int range);
};
extern MainWindow *main_window;
#endif