diff --git a/Libs/MRML/Core/vtkMRMLSliceNode.cxx b/Libs/MRML/Core/vtkMRMLSliceNode.cxx index 69bb3ad7d44b943016aa90cab75a06c9ebba486f..3edad59d417931311c3cd3d6e53c11c7716117d9 100644 --- a/Libs/MRML/Core/vtkMRMLSliceNode.cxx +++ b/Libs/MRML/Core/vtkMRMLSliceNode.cxx @@ -93,6 +93,7 @@ vtkMRMLSliceNode::vtkMRMLSliceNode() this->SliceVisible = 0; this->WidgetVisible = 0; + this->WidgetOutlineVisible = 1; this->WidgetNormalLockedToCamera = 0; this->UseLabelOutline = 0; @@ -895,6 +896,7 @@ void vtkMRMLSliceNode::WriteXML(ostream& of, int nIndent) of << " jumpMode=\"" << this->JumpMode << "\""; of << " sliceVisibility=\"" << (this->SliceVisible ? "true" : "false") << "\""; of << " widgetVisibility=\"" << (this->WidgetVisible ? "true" : "false") << "\""; + of << " widgetOutlineVisibility=\"" << (this->WidgetOutlineVisible ? "true" : "false") << "\""; of << " useLabelOutline=\"" << (this->UseLabelOutline ? "true" : "false") << "\""; of << " sliceSpacingMode=\"" << this->SliceSpacingMode << "\""; of << " prescribedSliceSpacing=\"" @@ -1078,6 +1080,17 @@ void vtkMRMLSliceNode::ReadXMLAttributes(const char** atts) this->WidgetVisible = 0; } } + else if (!strcmp(attName, "widgetOutlineVisibility")) + { + if (!strcmp(attValue,"true")) + { + this->WidgetOutlineVisible = 1; + } + else + { + this->WidgetOutlineVisible = 0; + } + } else if (!strcmp(attName, "useLabelOutline")) { if (!strcmp(attValue,"true")) @@ -1293,6 +1306,7 @@ void vtkMRMLSliceNode::Copy(vtkMRMLNode *anode) this->SliceSpacingMode = node->SliceSpacingMode; this->WidgetVisible = node->WidgetVisible; + this->WidgetOutlineVisible = node->WidgetOutlineVisible; this->UseLabelOutline = node->UseLabelOutline; this->SliceResolutionMode = node->SliceResolutionMode; @@ -1393,6 +1407,8 @@ void vtkMRMLSliceNode::PrintSelf(ostream& os, vtkIndent indent) (this->SliceVisible ? "true" : "false") << "\n"; os << indent << "WidgetVisible: " << (this->WidgetVisible ? "true" : "false") << "\n"; + os << indent << "WidgetOutlineVisible: " << + (this->WidgetOutlineVisible ? "true" : "false") << "\n"; os << indent << "UseLabelOutline: " << (this->UseLabelOutline ? "true" : "false") << "\n"; diff --git a/Libs/MRML/Core/vtkMRMLSliceNode.h b/Libs/MRML/Core/vtkMRMLSliceNode.h index 20c9bfe1de40c75c93868655788e526fd8702be9..b5857b204df764806b60282685177aeb75b6c765 100644 --- a/Libs/MRML/Core/vtkMRMLSliceNode.h +++ b/Libs/MRML/Core/vtkMRMLSliceNode.h @@ -82,6 +82,10 @@ class VTK_MRML_EXPORT vtkMRMLSliceNode : public vtkMRMLAbstractViewNode vtkGetMacro(WidgetVisible, int); vtkSetMacro(WidgetVisible, int); + /// The visibility of the slice plane widget outline in the 3DViewer. + vtkGetMacro(WidgetOutlineVisible, int); + vtkSetMacro(WidgetOutlineVisible, int); + /// Add View Node ID for the view to display this node in. /// \sa ViewNodeIDs, RemoveViewNodeID(), RemoveAllViewNodeIDs() void AddThreeDViewID(const char* viewNodeID); @@ -512,6 +516,7 @@ protected: int SliceVisible; int WidgetVisible; + int WidgetOutlineVisible; int WidgetNormalLockedToCamera; int UseLabelOutline; diff --git a/Libs/MRML/DisplayableManager/vtkMRMLThreeDReformatDisplayableManager.cxx b/Libs/MRML/DisplayableManager/vtkMRMLThreeDReformatDisplayableManager.cxx index d3f42647c656ce982ff2ae8ec338bf3fdc62b506..2227ca48f29257b83e4197ac840dafbe7f3baa1a 100644 --- a/Libs/MRML/DisplayableManager/vtkMRMLThreeDReformatDisplayableManager.cxx +++ b/Libs/MRML/DisplayableManager/vtkMRMLThreeDReformatDisplayableManager.cxx @@ -332,6 +332,8 @@ bool vtkMRMLThreeDReformatDisplayableManager::vtkInternal sliceToRAS->GetElement(1,3), sliceToRAS->GetElement(2,3)); + rep->SetDrawOutline(sliceNode->GetWidgetOutlineVisible()); + // Update the widget itself if necessary bool visible = sliceNode->IsDisplayableInThreeDView(this->External->GetMRMLViewNode()->GetID())