Skip to content

Commit

Permalink
Make bone default annotation and persistent
Browse files Browse the repository at this point in the history
See Issue #13729
  • Loading branch information
vovythevov committed Nov 23, 2012
1 parent a689f0b commit af462ab
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Modules/Loadable/Armatures/qSlicerArmaturesModuleWidget.cxx
Expand Up @@ -685,6 +685,32 @@ ::mrmlArmatureDisplayNode()
}
*/


//-----------------------------------------------------------------------------
void qSlicerArmaturesModuleWidget::setMRMLScene(vtkMRMLScene* scene)
{
this->Superclass::setMRMLScene(scene);

if (!this->mrmlScene())
{
return;
}

vtkMRMLSelectionNode* selectionNode = vtkMRMLSelectionNode::SafeDownCast(
this->mrmlScene()->GetNodeByID("vtkMRMLSelectionNodeSingleton"));
vtkMRMLInteractionNode* interactionNode =
vtkMRMLInteractionNode::SafeDownCast(
this->mrmlScene()->GetNodeByID("vtkMRMLInteractionNodeSingleton"));
if (!selectionNode || !interactionNode)
{
qCritical() << "Invalid scene, no interaction or selection node";
return;
}

selectionNode->SetReferenceDefaultAnnotationID("vtkMRMLBoneNode");
interactionNode->SetPlaceModePersistence(1);
}

//-----------------------------------------------------------------------------
void qSlicerArmaturesModuleWidget
::setMRMLBoneNode(vtkMRMLBoneNode* boneNode)
Expand Down
4 changes: 4 additions & 0 deletions Modules/Loadable/Armatures/qSlicerArmaturesModuleWidget.h
Expand Up @@ -58,6 +58,10 @@ class Q_SLICER_QTMODULES_ARMATURES_EXPORT qSlicerArmaturesModuleWidget
/// Return the display node of the current armature node if any, 0 otherwise.
/// \sa mrmlArmatureNode()
//vtkMRMLArmatureDisplayNode* mrmlArmatureDisplayNode()const;

/// Set the current MRML scene to the widget
virtual void setMRMLScene(vtkMRMLScene*);

public slots:
/// Set \a armatureNode as current.
/// \sa setMRMLArmatureNode(vtkMRMLNode*)
Expand Down

0 comments on commit af462ab

Please sign in to comment.