Permalink
Browse files

BUG: 3028. Update UI from fg,bg volume nodes on loading a volume in q…

…MRMLSliceControllerWidgetPrivate::updateFromMRMLScene()

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21838 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
1 parent c38b83a commit 47ddd9bac91b1fe1804461c8ba23dc4c86cb622b alexy committed Mar 23, 2013
Showing with 35 additions and 14 deletions.
  1. +32 −14 Libs/MRML/Widgets/qMRMLSliceControllerWidget.cxx
  2. +3 −0 Libs/MRML/Widgets/qMRMLSliceControllerWidget_p.h
@@ -892,12 +892,18 @@ void qMRMLSliceControllerWidgetPrivate::updateWidgetFromMRMLSliceCompositeNode()
q->mrmlScene()->GetNodeByID(this->MRMLSliceCompositeNode->GetForegroundVolumeID()));
this->ForegroundComboBox->blockSignals(wasBlocked);
+ this->updateFromForegroundVolumeNode(
+ q->mrmlScene()->GetNodeByID(this->MRMLSliceCompositeNode->GetForegroundVolumeID()));
+
// Update "background layer" node selector
wasBlocked = this->BackgroundComboBox->blockSignals(true);
this->BackgroundComboBox->setCurrentNode(
q->mrmlScene()->GetNodeByID(this->MRMLSliceCompositeNode->GetBackgroundVolumeID()));
this->BackgroundComboBox->blockSignals(wasBlocked);
+ this->updateFromBackgroundVolumeNode(
+ q->mrmlScene()->GetNodeByID(this->MRMLSliceCompositeNode->GetBackgroundVolumeID()));
+
// Update "label map" node selector
wasBlocked = this->LabelMapComboBox->blockSignals(true);
this->LabelMapComboBox->setCurrentNode(
@@ -951,13 +957,7 @@ void qMRMLSliceControllerWidgetPrivate::onForegroundLayerNodeSelected(vtkMRMLNod
this->enableLayerWidgets();
- vtkMRMLVolumeNode* volumeNode = vtkMRMLVolumeNode::SafeDownCast(node);
- vtkMRMLScalarVolumeDisplayNode* displayNode =
- vtkMRMLScalarVolumeDisplayNode::SafeDownCast(
- volumeNode ? volumeNode->GetVolumeDisplayNode() : 0);
- this->qvtkReconnect(displayNode, vtkCommand::ModifiedEvent,
- this, SLOT(updateFromForegroundDisplayNode(vtkObject*)));
- this->updateFromForegroundDisplayNode(displayNode);
+ this->updateFromForegroundVolumeNode(node);
}
// --------------------------------------------------------------------------
@@ -977,13 +977,7 @@ void qMRMLSliceControllerWidgetPrivate::onBackgroundLayerNodeSelected(vtkMRMLNod
this->enableLayerWidgets();
- vtkMRMLVolumeNode* volumeNode = vtkMRMLVolumeNode::SafeDownCast(node);
- vtkMRMLScalarVolumeDisplayNode* displayNode =
- vtkMRMLScalarVolumeDisplayNode::SafeDownCast(
- volumeNode ? volumeNode->GetVolumeDisplayNode(): 0);
- this->qvtkReconnect(displayNode, vtkCommand::ModifiedEvent,
- this, SLOT(updateFromBackgroundDisplayNode(vtkObject*)));
- this->updateFromBackgroundDisplayNode(displayNode);
+ this->updateFromBackgroundVolumeNode(node);
}
// --------------------------------------------------------------------------
@@ -1045,6 +1039,18 @@ void qMRMLSliceControllerWidgetPrivate::onSliceLogicModifiedEvent()
}
//---------------------------------------------------------------------------
+void qMRMLSliceControllerWidgetPrivate::updateFromForegroundVolumeNode(vtkObject* node)
+{
+ vtkMRMLVolumeNode* volumeNode = vtkMRMLVolumeNode::SafeDownCast(node);
+ vtkMRMLScalarVolumeDisplayNode* displayNode =
+ vtkMRMLScalarVolumeDisplayNode::SafeDownCast(
+ volumeNode ? volumeNode->GetVolumeDisplayNode(): 0);
+ this->qvtkReconnect(displayNode, vtkCommand::ModifiedEvent,
+ this, SLOT(updateFromForegroundDisplayNode(vtkObject*)));
+ this->updateFromForegroundDisplayNode(displayNode);
+}
+
+//---------------------------------------------------------------------------
void qMRMLSliceControllerWidgetPrivate::updateFromForegroundDisplayNode(vtkObject* node)
{
vtkMRMLScalarVolumeDisplayNode* displayNode =
@@ -1057,6 +1063,18 @@ void qMRMLSliceControllerWidgetPrivate::updateFromForegroundDisplayNode(vtkObjec
}
//---------------------------------------------------------------------------
+void qMRMLSliceControllerWidgetPrivate::updateFromBackgroundVolumeNode(vtkObject* node)
+{
+ vtkMRMLVolumeNode* volumeNode = vtkMRMLVolumeNode::SafeDownCast(node);
+ vtkMRMLScalarVolumeDisplayNode* displayNode =
+ vtkMRMLScalarVolumeDisplayNode::SafeDownCast(
+ volumeNode ? volumeNode->GetVolumeDisplayNode(): 0);
+ this->qvtkReconnect(displayNode, vtkCommand::ModifiedEvent,
+ this, SLOT(updateFromBackgroundDisplayNode(vtkObject*)));
+ this->updateFromBackgroundDisplayNode(displayNode);
+}
+
+//---------------------------------------------------------------------------
void qMRMLSliceControllerWidgetPrivate::updateFromBackgroundDisplayNode(vtkObject* node)
{
vtkMRMLScalarVolumeDisplayNode* displayNode =
@@ -118,6 +118,9 @@ public slots:
void updateFromForegroundDisplayNode(vtkObject* displayNode);
void updateFromBackgroundDisplayNode(vtkObject* displayNode);
+ void updateFromForegroundVolumeNode(vtkObject* volumeNode);
+ void updateFromBackgroundVolumeNode(vtkObject* volumeNode);
+
void applyCustomLightbox();
protected:

0 comments on commit 47ddd9b

Please sign in to comment.