13CAD
CAD-like software based on C++, Qt and VTK.
 All Classes Files Functions Variables Friends
mainwindow.h
Go to the documentation of this file.
1 
8 #ifndef MAINWINDOW_H
9 #define MAINWINDOW_H
10 
11 #include <QMainWindow>
12 
13 #include <QImage>
14 #include <QPixmap>
15 #include <QFileDialog>
16 #include <QMessageBox>
17 #include <QScreen>
18 #include <QGuiApplication>
19 #include <QColorDialog>
20 #include <QInputDialog>
21 #include <QLineEdit>
22 #include <QString>
23 #include <QAction>
24 #include <QActionGroup>
25 
26 #include "clipdialog.h"
27 
28 namespace Ui {
29  class MainWindow;
30 }
31 
35 class MainWindow : public QMainWindow
36 {
37  Q_OBJECT
38 
39  ClipDialog *clipWindow = nullptr;
40 
41  signals:
42 
46  void statusUpdateMessage(const QString &message, int timeout);
47 
48  public:
49  explicit MainWindow(QWidget *parent = 0);
50  ~MainWindow();
51 
52  private:
53 
54  Ui::MainWindow *ui;
55 
59  void setupWindow();
60 
64  void setupButtons(bool modelLoaded);
65 
69  void setupIcons();
70 
74  void setupConnects();
75 
79  void loadModel(QString inputFilename);
80 
84  void clearModel();
85 
89  void resetCamera();
90 
91  public slots:
92 
96  void handleActionOpen();
97 
101  void handleActionSave();
102 
106  void handleActionClose();
107 
111  void handleActionPrint();
112 
117 
121  void handleActionShowAxes();
122 
126  void handleActionFullScreen();
127 
131  void handleActionExportData();
132 
136  void handleActionAbout();
137 
142 
147 
152 
157 
161  void handleActionStlTest();
162 
166  void handleActionModTest();
167 
168  private slots:
169 
170  // Filters
171 
175  void on_shrinkButton_clicked();
176 
180  void on_clipButton_clicked();
181 
185  void on_resetFiltersButton_clicked();
186 
187  // Properties
188 
192  void on_bkgColourButton_clicked();
193 
197  void on_gradientCheckBox_stateChanged(int state);
198 
202  void on_modColourButton_clicked();
203 
207  void on_resetPropertiesButton_clicked();
208 
209  // Lighting
210  // Note on opacity and specularity sliders:
211  // If a STL model is loaded, there is only one actor,
212  // thus changing the opacity as the slider is moved
213  // is not resource expensive.
214  // If a MOD model is loaded, there will be many actors,
215  // thus the opacity is only changed when the value is changed.
216 
220  void on_opacitySlider_sliderMoved(int position);
221 
225  void on_opacitySlider_valueChanged(int value);
226 
230  void on_specularitySlider_sliderMoved(int position);
231 
235  void on_specularitySlider_valueChanged(int value);
236 
240  void on_intensitySlider_sliderMoved(int position);
241 
245  void on_intensityCheckBox_stateChanged(int state);
246 
250  void on_showAxesCheckBox_stateChanged(int state);
251 
255  void on_resetLightingButton_clicked();
256 
260  void on_clipXSlider_sliderMoved(int position);
261 
265  void on_clipYSlider_sliderMoved(int position);
266 
270  void on_clipZSlider_sliderMoved(int position);
271 
275  void on_clipXDial_sliderMoved(int position);
276 
280  void on_clipYDial_sliderMoved(int position);
281 
285  void on_clipZDial_sliderMoved(int position);
286 
290  void on_clipDialog_dialogAccepted();
291 
295  void on_clipDialog_dialogRejected();
296 
297  // Camera
298  // Note for the camera functions:
299  // The view up vector must be set to be orthogonal to the camera direction.
303  void on_resetCameraButton_clicked();
304 
308  void on_posXButton_clicked();
309 
313  void on_posYButton_clicked();
314 
318  void on_posZButton_clicked();
319 
323  void on_pos90Button_clicked();
324 
328  void on_negXButton_clicked();
329 
333  void on_negYButton_clicked();
334 
338  void on_negZButton_clicked();
339 
343  void on_neg90Button_clicked();
344 
345  // Visualization
346 
350  void on_wireframeRadio_toggled(bool checked);
351 
355  void on_pointsRadio_toggled(bool checked);
356 
360  void on_surfaceRadio_toggled(bool checked);
361 };
362 
363 #endif // MAINWINDOW_H
void handleActionResetCamera()
Definition: mainwindow.cpp:801
void handleActionStlTest()
Definition: mainwindow.cpp:666
void handleActionEnableIntensity()
Definition: mainwindow.cpp:1235
void statusUpdateMessage(const QString &message, int timeout)
void handleActionPrint()
Definition: mainwindow.cpp:688
void handleActionModTest()
Definition: mainwindow.cpp:677
void handleActionOpen()
Definition: mainwindow.cpp:606
void handleActionShowAxes()
Definition: mainwindow.cpp:1248
void handleActionResetProperties()
Definition: mainwindow.cpp:806
void handleActionAbout()
Definition: mainwindow.cpp:734
void handleActionExportData()
Definition: mainwindow.cpp:740
Definition: clipdialog.h:23
void handleActionFullScreen()
Definition: mainwindow.cpp:722
void handleActionSave()
Definition: mainwindow.cpp:627
void handleActionClose()
Definition: mainwindow.cpp:655
void handleActionResetFilters()
Definition: mainwindow.cpp:796
void handleActionResetLighting()
Definition: mainwindow.cpp:811
Definition: mainwindow.h:35
Header file for the clip filter dialog.