KurusView  1.0
modelwindow.h
1 #ifndef KURUSVIEW_MODELWINDOW_H
2 #define KURUSVIEW_MODELWINDOW_H
3 
4 #include <QMainWindow>
5 #include <QMouseEvent>
6 #include <QStringList>
7 #include <QList>
8 
9 #include <memory>
10 #include <vector>
11 
12 #include <vtkAlgorithm.h>
13 #include <vtkDataSetMapper.h>
14 #include <vtkSmartPointer.h>
15 #include <vtkClipDataSet.h>
16 #include <vtkShrinkFilter.h>
17 #include <vtkDistanceWidget.h>
18 #include <QLabel>
19 #include <QSettings>
20 #include <vtkColor.h>
21 
22 #include "MModel.h"
23 #include "KView.h"
24 
25 // wrap the class in Ui::
26 namespace Ui {
27  class ModelWindow;
28 }
29 
33 class ModelWindow : public QMainWindow {
34 Q_OBJECT
35 
36 public:
43  explicit ModelWindow(const QStringList &filePaths, QWidget *parent = nullptr);
44 
48  ~ModelWindow() override;
49 
54  void addViewToFrame(KView *view);
55 
56  QMenu *fileMenu;
57  QMenu *recentFilesMenu;
58 
59  QAction *openAction;
60  QList<QAction *> recentFileActionList;
61  const unsigned int maxFileNr;
62 
63  QString currentFilePath;
64 
68  void createActionsAndConnections();
69 
74  void adjustForCurrentFile(const QString &filePath);
75 
79  void updateRecentActionList();
80 
81  QSettings settings;
82 
83 signals:
84 
89  void openNewModelWindow(const QStringList &filePaths);
90 
91 private:
92  Ui::ModelWindow *ui;
93  std::vector<KView *> views;
94  KView *activeView;
95  QString currentModelFilePath;
96 
101  void setActiveView(KView *newActiveView);
102 
103 
104  QStringList recentFilePaths;
105 
110  void loadFile(const QStringList &filePaths);
111 
115  void resetViewLayout();
116 
117 
118 private slots:
119 
123  void openRecent();
124 
128  void open();
129 
133  void closeView();
134 
135 public slots:
136 
141  void viewActive(QMouseEvent *event);
142 
147  void handleBackgroundColor();
148 
152  void handleModelColor();
153 
157  void handleModelBackFaceColor();
158 
162  void handleResetColor();
163 
167  void handleResetLighting();
168 
173  void handleLightIntensitySlider(int position);
174 
180  void mux_handleLightActorSlider(int position);
181 
185  void handleChangePerspective();
186 
190  void updateFilters();
191 
195  void updateStructure();
196 
200  void handleGridlines();
201 
205  void handleMeasurement();
206 
207 
212  void getStatistics();
213 
217  void handleHelpButton();
218 
222  void handleSettingsButton();
223 
227  void handleSaveButton();
228 
233  void dragEnterEvent(QDragEnterEvent *e);
234 
239  void dropEvent(QDropEvent *e);
240 };
241 
242 
243 #endif //KURUSVIEW_MODELWINDOW_H
Definition: dialog.h:7
View class - abstracts all rendering duties. Has no effect on UI elements, which are handled by Model...
Definition: KView.h:32
Holds Views and handles ui elements.
Definition: modelwindow.h:33