-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQCustomVTKWidget.cpp
More file actions
82 lines (67 loc) · 1.24 KB
/
Copy pathQCustomVTKWidget.cpp
File metadata and controls
82 lines (67 loc) · 1.24 KB
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
#include "QCustomVTKWidget.h"
QCustomVTKWidget::QCustomVTKWidget(QWidget *)
{
m_value=0;
disFlag = false;
angFlag = false;
dpTimes = 0;
}
QCustomVTKWidget::~QCustomVTKWidget(void)
{
}
void QCustomVTKWidget::wheelEvent(QWheelEvent* event)
{
if(event->delta()>0)
m_value=1;
else
m_value=-1;
emit wheelScrolled();
}
void QCustomVTKWidget::mouseReleaseEvent(QMouseEvent* event)
{
QVTKWidget::mouseReleaseEvent(event);
if(event->button()==Qt::LeftButton)
{
emit ChgSlice();
}
}
void QCustomVTKWidget::mouseDoubleClickEvent(QMouseEvent* event)
{
if(event->button()==Qt::LeftButton)
{
QKeyEvent *eKeyEvent=new QKeyEvent(QEvent::KeyPress,Qt::Key_P,Qt::NoModifier,QString(QChar(Qt::Key_P)));
QVTKWidget::keyPressEvent(eKeyEvent);
delete eKeyEvent;
if(disFlag)
{
++dpTimes;
emit disMeasure();
}
if(angFlag)
{
++dpTimes;
emit angMeasure();
}
emit fixPoint();
}
}
void QCustomVTKWidget::resizeEvent(QResizeEvent *event)
{
QVTKWidget::resizeEvent(event);
emit customResize();
}
void QCustomVTKWidget::keyReleaseEvent(QKeyEvent *event)
{
if(event->key()==Qt::Key_Shift)
{
emit shift();
}
if(event->key()==Qt::Key_Space)
{
emit EndSelect();
}
if(event->key()==Qt::Key_Delete)
{
emit DeleteSelect();
}
}