VR CAD Viewer 1.0
Qt and VTK application for loading and visualising CAD models with VR support
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1
9#ifndef MAINWINDOW_H
10#define MAINWINDOW_H
11#include "ModelPart.h"
12#include "ModelPartList.h"
13#include <QMainWindow>
14#include <vtkSmartPointer.h>
15#include "VRRenderThread.h"
16
17QT_BEGIN_NAMESPACE
18namespace Ui {
19class MainWindow;
20}
21QT_END_NAMESPACE
22
23class vtkRenderer;
24class vtkGenericOpenGLRenderWindow;
25
30class MainWindow : public QMainWindow
31{
32 Q_OBJECT
33
34signals:
39 void statusUpdateMessage(const QString &message, int timeout);
40
41public:
45 MainWindow(QWidget *parent = nullptr);
46
50
51public slots:
55 void handleTreeClicked(const QModelIndex &index);
56
60
61private slots:
65 void openContextMenu(const QPoint &pos);
66
69 void removeSelectedItem();
70
73 void on_actionOpen_File_triggered();
74
77 void startVR();
78
81 void stopVR();
82
85 void on_actionOpen_Folder_triggered();
86
89 void toggleVRAnimation();
90
93 void resetModelView();
94
97 void toggleExplode();
98
99private:
100 Ui::MainWindow *ui;
101 ModelPartList* partList;
102 vtkSmartPointer<vtkRenderer> renderer;
103 vtkSmartPointer<vtkGenericOpenGLRenderWindow> renderWindow;
107 void updateRender();
108
112 void updateRenderFromTree(const QModelIndex& index);
113
114 QModelIndex partsRootIndex;
115 VRRenderThread* vrThread;
122 int addVRActorsFromTree(const QModelIndex& index, VRRenderThread* thread);
123
130 int loadSTLFilesFromDirectory(const QString& dirPath, QModelIndex parentIndex, bool recursive);
131
135 void applyPropertiesToChildren(ModelPart* parentPart);
136
137 bool vrAnimationEnabled = false;
142 void addPartToLiveVR(ModelPart* part);
143
147 void queueVRUpdatesFromTree(const QModelIndex& index);
148};
149#endif // MAINWINDOW_H
Defines the ModelPartList class used as the Qt model for displaying model parts in a tree view.
Defines the ModelPart class used to represent CAD model parts in the tree view and VTK renderer.
Definition mainwindow.h:31
void statusUpdateMessage(const QString &message, int timeout)
void handleTreeClicked(const QModelIndex &index)
Definition mainwindow.cpp:164
void handleClearSelection()
Definition mainwindow.cpp:475
~MainWindow()
Definition mainwindow.cpp:159
Model class used by Qt to display ModelPart objects in a tree view.
Definition ModelPartList.h:30
Represents one CAD model part in the application.
Definition ModelPart.h:30
Definition VRRenderThread.h:35