13 #include <QHBoxLayout> 14 #include <QVBoxLayout> 18 #include <QGridLayout> 21 #include <QPushButton> 45 mVerticalLayout(new QVBoxLayout(this)),
46 mControlsEnabled(false),
47 mAutomaticRotation(true),
49 mStorage(new
PatientStorage(services->session(),
"VirtualBronchoscopy"))
51 this->setObjectName(
"virtual_bronchoscopy_widget");
52 this->setWindowTitle(
"Virtual Bronchoscopy");
55 this->setFocusPolicy(Qt::StrongFocus);
59 mStorage->storeVariable(
"routeToTarget",
64 QVBoxLayout *inputVbox =
new QVBoxLayout;
66 QGroupBox *inputBox =
new QGroupBox(tr(
"Input"));
67 inputBox->setLayout(inputVbox);
71 mPlayButton =
new QPushButton(QIcon(
":/icons/open_icon_library/media-playback-start-3.png"),
"");
73 connect(
mTimer, SIGNAL(timeout()),
this, SLOT(moveCameraSlot()));
77 QHBoxLayout *playbackHBox =
new QHBoxLayout;
78 QGroupBox *playbackBox =
new QGroupBox(tr(
"Playback"));
80 QLabel *labelStart =
new QLabel(tr(
"Start "));
81 QLabel *labelTarget =
new QLabel(tr(
" Target"));
83 playbackHBox->addWidget(labelStart);
85 playbackHBox->addWidget(labelTarget);
86 playbackBox->setLayout(playbackHBox);
92 QGroupBox *endoscopeBox =
new QGroupBox(tr(
"Bronchoscope"));
93 QGridLayout *endoscopeControlLayout =
new QGridLayout;
94 QLabel *labelRot =
new QLabel(tr(
"Rotate (360 deg)"));
95 QLabel *labelView =
new QLabel(tr(
"Left/right (+/- 60 deg)"));
108 endoscopeControlLayout->addWidget(labelRot,0,0,Qt::AlignHCenter);
109 endoscopeControlLayout->addWidget(labelView,0,2,Qt::AlignHCenter);
110 endoscopeControlLayout->addWidget(
mRotateDial,1,0);
111 endoscopeControlLayout->addWidget(
mViewDial,1,2);
114 endoscopeBox->setLayout(endoscopeControlLayout);
125 this, &VBWidget::inputChangedSlot, Qt::UniqueConnection);
179 fileInfo.setFile(
mServices->patient()->generateFilePath(
"Screenshots",
"mp4"));
187 if(
vlc()->isRecording())
200 void VBWidget::inputChangedSlot()
208 if (event->key()==Qt::Key_Up ||
event->key()==Qt::Key_8)
217 if (event->key()==Qt::Key_Down ||
event->key()==Qt::Key_2)
226 if (event->key()==Qt::Key_Right ||
event->key()==Qt::Key_6)
235 if (event->key()==Qt::Key_Left ||
event->key()==Qt::Key_4)
244 if (event->key()==Qt::Key_PageUp ||
event->key()==Qt::Key_9)
253 if (event->key()==Qt::Key_PageDown ||
event->key()==Qt::Key_3)
262 if (event->key()==Qt::Key_5)
265 this->resetEndoscopeSlot();
271 QWidget::keyPressEvent(event);
284 mPlayButton->setIcon(QIcon(
":/icons/open_icon_library/media-playback-start-3.png"));
295 mPlayButton->setIcon(QIcon(
":/icons/open_icon_library/media-playback-pause-3.png"));
299 void VBWidget::moveCameraSlot()
311 void VBWidget::resetEndoscopeSlot()
317 void VBWidget::automaticRotationSlot()
333 void VBWidget::updateRotationDialSlot(
int value)
341 "<h3>Virtual Bronchoscopy.</h3>" 342 "<p>GUI for visualizing a route-to-target path</p>"
void setWritePositionsFilePath(QString path)
bool waitForFinished(int msecs=30000)
void rotationChanged(int value)
void setAutomaticRotation(bool automaticRotation)
void cameraRawPointsSlot(MeshPtr mesh)
void cameraPathPositionSlot(int positionPermillage)
boost::shared_ptr< class VisServices > VisServicesPtr
Helper class for storing variables in the patient file.
void dataChanged(QString)
void setCameraRotations(std::vector< double > cameraRotations)
void startRecording(QString saveFile)
void cameraRotateAngleSlot(int angle)
virtual QString getValue() const
get the data value.
void setBranchingIndexAlongRoute(std::vector< int > branchingIndex)
void cameraViewAngleSlot(int angle)
void setRoutePositions(std::vector< Eigen::Vector3d > routePositions)
static StringPropertySelectMeshPtr New(PatientModelServicePtr patientModelService)
virtual bool setValue(const QString &value)
set the data value.
void setWritePositionsToFile(bool write)
VLCRecorder * vlc()
Shortcut for accessing the vlc recorder.
Namespace for all CustusX production code.