Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions RoomsEyeView/Resources/UI/qSlicerRoomsEyeViewModule.ui
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<item row="2" column="0" colspan="3">
<widget class="QLabel" name="CollisionDetectionStatusLabel">
<property name="text">
<string>No collisions detected.</string>
<string>Collision computation enabled</string>
</property>
</widget>
</item>
Expand All @@ -278,14 +278,24 @@
</property>
</spacer>
</item>
<item row="0" column="0">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="ActivateCollisionComputationCheckBox">
<property name="text">
<string>Enable computation</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Patient body:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="qMRMLSegmentSelectorWidget" name="SegmentSelectorWidget_PatientBody" native="true">
<property name="noneEnabled" stdset="0">
<bool>true</bool>
Expand Down
16 changes: 15 additions & 1 deletion RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ void qSlicerRoomsEyeViewModuleWidget::setup()
// 3D camera control
connect(d->FixedCameraCheckBox, SIGNAL(toggled(bool)), this, SLOT(setFixedReferenceCameraEnabled(bool)));

// Collision detection control
connect(d->ActivateCollisionComputationCheckBox, SIGNAL(toggled(bool)), this, SLOT(setCollisionComputationEnabled(bool)));

// Disable treatment machine geometry controls until a machine is loaded
d->GantryRotationSlider->setEnabled(false);
d->CollimatorRotationSlider->setEnabled(false);
Expand Down Expand Up @@ -1004,7 +1007,7 @@ void qSlicerRoomsEyeViewModuleWidget::checkForCollisions()
Q_D(qSlicerRoomsEyeViewModuleWidget);

vtkMRMLRoomsEyeViewNode* paramNode = vtkMRMLRoomsEyeViewNode::SafeDownCast(d->MRMLNodeComboBox_ParameterSet->currentNode());
if (!paramNode || !d->ModuleWindowInitialized)
if (!paramNode || !d->ModuleWindowInitialized|| !paramNode->GetCollisionDetectionEnabled())
{
return;
}
Expand Down Expand Up @@ -1093,3 +1096,14 @@ void qSlicerRoomsEyeViewModuleWidget::setFixedReferenceCameraEnabled(bool toggle
}
cameraNode->SetAndObserveTransformNodeID(nullptr);
}

//-----------------------------------------------------------------------------
void qSlicerRoomsEyeViewModuleWidget::setCollisionComputationEnabled(bool toggled)
{
Q_D(qSlicerRoomsEyeViewModuleWidget);
vtkMRMLRoomsEyeViewNode* paramNode = vtkMRMLRoomsEyeViewNode::SafeDownCast(d->MRMLNodeComboBox_ParameterSet->currentNode());
paramNode->SetCollisionDetectionEnabled(toggled);
QString collisionsMessage(toggled ? tr("Collision computation enabled") : tr("Collision computation disabled"));
d->CollisionDetectionStatusLabel->setText(collisionsMessage);
d->CollisionDetectionStatusLabel->setStyleSheet("color: black");
}
1 change: 1 addition & 0 deletions RoomsEyeView/qSlicerRoomsEyeViewModuleWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public slots:
void updateTreatmentOrientationMarker();

void setFixedReferenceCameraEnabled(bool);
void setCollisionComputationEnabled(bool);

protected slots:
void onLoadTreatmentMachineButtonClicked();
Expand Down