13 #include <QHBoxLayout>
14 #include <QVBoxLayout>
18 #include <QGridLayout>
21 #include <QPushButton>
42 mVerticalLayout(new QVBoxLayout(this)),
43 mControlsEnabled(false),
44 mAutomaticRotation(true),
45 mStorage(new
PatientStorage(services->session(),
"VirtualBronchoscopy"))
47 this->setObjectName(
"virtual_bronchoscopy_widget");
48 this->setWindowTitle(
"Virtual Bronchoscopy");
51 this->setFocusPolicy(Qt::StrongFocus);
55 mStorage->storeVariable(
"routeToTarget",
60 QVBoxLayout *inputVbox =
new QVBoxLayout;
62 QGroupBox *inputBox =
new QGroupBox(tr(
"Input"));
63 inputBox->setLayout(inputVbox);
67 QHBoxLayout *playbackHBox =
new QHBoxLayout;
68 QGroupBox *playbackBox =
new QGroupBox(tr(
"Playback"));
70 QLabel *labelStart =
new QLabel(tr(
"Start "));
71 QLabel *labelTarget =
new QLabel(tr(
" Target"));
72 playbackHBox->addWidget(labelStart);
74 playbackHBox->addWidget(labelTarget);
75 playbackBox->setLayout(playbackHBox);
81 QGroupBox *endoscopeBox =
new QGroupBox(tr(
"Bronchoscope"));
82 QGridLayout *endoscopeControlLayout =
new QGridLayout;
83 QLabel *labelRot =
new QLabel(tr(
"Rotate (360 deg)"));
84 QLabel *labelView =
new QLabel(tr(
"Left/right (+/- 60 deg)"));
97 endoscopeControlLayout->addWidget(labelRot,0,0,Qt::AlignHCenter);
98 endoscopeControlLayout->addWidget(labelView,0,2,Qt::AlignHCenter);
100 endoscopeControlLayout->addWidget(
mViewDial,1,2);
103 endoscopeBox->setLayout(endoscopeControlLayout);
114 this, &VBWidget::inputChangedSlot, Qt::UniqueConnection);
161 void VBWidget::inputChangedSlot()
169 if (event->key()==Qt::Key_Up || event->key()==Qt::Key_8)
178 if (event->key()==Qt::Key_Down || event->key()==Qt::Key_2)
187 if (event->key()==Qt::Key_Right || event->key()==Qt::Key_6)
196 if (event->key()==Qt::Key_Left || event->key()==Qt::Key_4)
205 if (event->key()==Qt::Key_PageUp || event->key()==Qt::Key_9)
214 if (event->key()==Qt::Key_PageDown || event->key()==Qt::Key_3)
223 if (event->key()==Qt::Key_5)
226 this->resetEndoscopeSlot();
232 QWidget::keyPressEvent(event);
235 void VBWidget::resetEndoscopeSlot()
241 void VBWidget::automaticRotationSlot()
257 void VBWidget::updateRotationDialSlot(
int value)
265 "<h3>Virtual Bronchoscopy.</h3>"
266 "<p>GUI for visualizing a route-to-target path</p>"