Slicer: 2145-support-for-installing-extension-from-file edb07a87

Author Committer Branch Timestamp Parent
johan.andruejol johan.andruejol 2145-support-for-installing-extension-from-file 2013-06-04 15:31:29 2145-support-for-installing-extension-from-file db75d3d5
Affected Issues 0003145: New Units code leading to mrml xml issues
Changeset

BUG: Fix MRMLScene import and export

In the selection node, the unit didn't add a
NodeReferenceMRMLAttributeNames for each of its reference role. These
attributes are used when saving the mrml scene to describe what the
reference role is used for. Most notably, this can be used when importing
a scene.
However, since there wasn't any defined for the selection node, a saved
scene would look like this:
... selected="false" ="vtkMRMLUnitNodeApplicationLength" "vtkMRMLUnitNodeApplicationTime" activeVolumeID="NULL" ...
Which is an invalid format for the scene.

Adding a NodeReferenceMRMLAttributeNames is usually done in the class
constructor. In our case, we assume that we don't know what kind of unit
quantity can be added. Thus we don't know the ReferenceRoles we will need
at constructor time. So we add theses roles in the SetUnitNodeID().
The roles names are based on the quantity, and aren't actually used
anywhere.

To make sure this works, a test opening Slicer, saving a scene and loading
it again is added.

See Issue 0003145

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22075 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Applications/SlicerApp/Testing/Python/CMakeLists.txt Diff File
add - Applications/SlicerApp/Testing/Python/MRMLSceneImportAndExport.py Diff File
mod - Libs/MRML/Core/vtkMRMLSelectionNode.cxx Diff File