forked from alankzh/MNavigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
160 lines (132 loc) · 4.41 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "customThread/progressbarwidget.h"
#include "customThread/loadthreadhelper.h"
#include <string>
#include <math.h>
#include "customAnimator/animator.h"
#include "customAnimator/motion.h"
#include "qts.h"
#include "vtks.h"
#include "myvolumewidget.h"
#include "myslicerwidget.h"
#include "vtkcustomtransformanimationcue.h"
#include "stlmanager.h"
#include "actormanager.h"
#include "customWidgets/greenbutton.h"
#include "customWidgets/backgroundbutton.h"
#include "customWidgets/mygridlayout.h"
#include "customWidgets/mydialog.h"
#include "customWidgets/threebackgroundbutton.h"
#include "customWidgets/markbutton.h"
#include "customWidgets/selectpropertywidget.h"
#include "tools/constant.h"
#include "tools/screentools.h"
/**
* @brief The MainWindow class
* 这是主窗口
*/
class MainWindow : public QWidget
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private:
bool m_embedded;
QPixmap m_background;
void init();
void setLayout();
void setLayout2();
void setConnection();
void setDrawConnection();
void onOpenVolumeDir();
void obtainFocus();
StlManager *stlManager;
actorManager *actorM;
QPushButton *proSelectButton;
SelectPropertyWidget *selectProWidget;
BackgroundButton *titleButton;
ThreeBackgroundButton *minimizeButton;//最小化主窗口
ThreeBackgroundButton *maxmizeButton;//最大化
ThreeBackgroundButton *exitButton;
/*start-edit with lvyunxiao -----------------------------------------------------*/
MarkButton *pEndMarkButton;
MarkButton *pStartMarkButton;
/*end-edit with lvyunxiao------------------------------------------------------------*/
BackgroundButton *volumeLoadButton;
BackgroundButton *stlLoadButton;
BackgroundButton *stlSelectButton;
BackgroundButton *stlDeleteButton;//按下弹出删除哪个.stl模型的对话框
BackgroundButton *volumeMagnifyButton;
BackgroundButton *magnifyButton;
BackgroundButton *shrinkButton;
myVolumeWidget *volumeWidget;
mySlicerWidget *sagitalWidget;
mySlicerWidget *coronalWidget;
mySlicerWidget *axialWidget;
QSlider *volumeSlider;
QSlider *coronalSlider;
QSlider *axialSlider;
QSlider *sagitalSlider;
QLabel *sagitalLabel;
QLabel *axialLabel;
QLabel *coronalLabel;
MyDialog *stlLoadDialog;//选择加载哪个.stl模型
MyDialog *stlSelectDialog;//选择操作哪个.stl模型
MyDialog *stlDeleteDialog;//选择删除哪个.stl模型
bool isOpenDir=false;
int lastposition;
//能否做标记
bool canTarger=false;
//vtk qt 事件链接
vtkSmartPointer<vtkEventQtSlotConnect> vtkQtConnect;
//体绘制数据
vtkSmartPointer<vtkVolume> volume;
//当前操作的stl名
QString operationStlName;
bool max=false;
QPoint mouseClickPoint;
bool isMouseHover=false;
ProgressBarWidget *progressBar;
ProgressObserver::Pointer observer;
ProgressReceive *receive;
LoadThreadHelper *threadHelper=NULL;
signals:
void Mark(vtkVector3d ModelPosition);
public slots:
void volumeLoadClicked();
void exitClicked();
void volumeMagnifyClicked();
void magnifyClicked();
void shrinkCliked();
void focusButtonClicked();
void maxmizeClicked();
void minimizeClicked();
void vSlicerValueChange(int v);
void sSlicerValueChange(int v);
void aSlicerValueChange(int v);
void cSlicerValueChange(int v);
void stlLoadButtonClicked();
void stlSelectButtonClicked();
void stlDeleteButtonClicked();
void deleteStl(QString name, int index);
void loadStl(QString name, int index);
void selectStl(QString name, int index);
/*start-edit with lvyunxiao--------------------------------------------*/
void volumeSlicerRetunZero();
void onDataLoadingDone();
void receiveFocus();
void markedAnimator(bool marked);
void startSurgeryAnimator(double startPosition[3],double endPosition[3]);
/*end-edit with lvyunxiao-----------------------------------------------*/
protected:
void update_background();
virtual void paintEvent(QPaintEvent* event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
QList<QString> stlList={};
};
#endif // MAINWINDOW_H