-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainWindow.h
132 lines (103 loc) · 2.81 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMdiArea>
#include <QtGui/QMainWindow>
#include <QSignalMapper>
#include "ui_fabrication.h"
#include "vtkWidget.h"
#include "vtkView.h"
#include "InteractorStyleMoveGlyph.h"
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
~MainWindow();
void setHandleMenu(QPoint point, Qt::Orientation orientation, QSplitter *origin);
inline VtkWidget *VTKA() const
{
if(mdiArea->currentSubWindow()==0) return 0;
VtkView *mvc = currentVtkView();
if(!mvc) return 0;
VtkWidget *glw = qobject_cast<VtkWidget*>(mvc->currentView());
if(!glw) return 0;
return glw;
}
inline VtkView* currentVtkView() const
{
if(mdiArea->currentSubWindow()==0) return 0;
VtkView *mvc = qobject_cast<VtkView *>(mdiArea->currentSubWindow());
if(!mvc)
{
mvc = qobject_cast<VtkView *>(mdiArea->currentSubWindow()->widget());
return mvc;
}
else return 0;
}
inline VtkWidget *VTKAObject()
{
if(mdiArea->currentSubWindow()==0) return 0;
QList<QMdiSubWindow*> windows = mdiArea->subWindowList();
VtkView* mvc = qobject_cast<VtkView *>(windows[0]->widget());
if(!mvc) return 0;
VtkWidget *glw = qobject_cast<VtkWidget*>(mvc->currentView());
return glw;
}
inline VtkWidget *VTKAImage() const
{
if(mdiArea->currentSubWindow()==0) return 0;
QList<QMdiSubWindow*> windows = mdiArea->subWindowList();
VtkView* mvc = qobject_cast<VtkView *>(windows[1]->widget());
if(!mvc) return 0;
VtkWidget *glw = qobject_cast<VtkWidget*>(mvc->currentView());
return glw;
}
public slots:
void selectOnOnject(vtkSmartPointer<vtkPolyData> path);
void updateAllViews();
private:
void createActions();
void createMenus();
QMdiSubWindow* newImage();
bool isVisible(double *point, vtkSmartPointer<vtkRenderer> render);
void updateMenu();
private slots:
void open(QString fileName = QString());
void draw();
void select();
void rotate();
void exportModel();
void setActiveSubWindow(QWidget *window);
void wrapSetActiveSubWindow(QWidget* window);
private:
Ui::fabricationClass ui;
QMdiArea* mdiArea;
QMenuBar *menuBar;
QSignalMapper *windowMapper;
QAction* openAct;
QAction* drawAct;
QAction* selectAct;
QAction* rotateAct;
QAction* exportAct;
QMenu *handleMenu;
QMenu *splitMenu;
QMenu *unSplitMenu;
QAction *setSplitHAct;
QAction *setSplitVAct;
QActionGroup *setSplitGroupAct;
QAction *setUnsplitAct;
QActionGroup *splitGroupAct;
QActionGroup *unsplitGroupAct;
QAction *splitUpAct;
QAction *splitDownAct;
QAction *unsplitUpAct;
QAction *unsplitDownAct;
QAction *splitRightAct;
QAction *splitLeftAct;
QAction *unsplitRightAct;
QAction *unsplitLeftAct;
vtkSmartPointer<vtkUnstructuredGrid> selecteddata;
std::vector<int> typeIds;
InteractorStyleMoveGlyph* moveStyle;
};
#endif // FABRICATION_H