Import 2017-06-07 23:51:09: master c56baf5f

Author Committer Branch Timestamp Parent
jcfr jcfr master 2015-10-06 22:55:56 master 30a89fef
Affected Issues 0004040: fix vtkMRMLSceneImportIDModelHierarchyConflictTest
Changeset

BUG: Do not reset reference when importing scene. Fixes 0004040

This commit fixes a regression introduced in r24393 [1] where a node and its
referenced nodes would be modified if node with the same ID were imported.

The issue is due to the MRML scene being set to the node just before the
function "ReadXMLAttributes()" is called in "vtkMRMLParser::StartElement".

Indeed, since within "ReadXMLAttributes()", the method "AddNodeReferenceID()"
is called, when the ID of a node being imported conflicts with an existing
one in the scene, it causes the existing node to be updated. For example,
this problem is observed in test where a conflicting "vtkMRMLDisplayableNode"
is imported.

Other approach could be to ensure no events are invoked in the method
"vtkMRMLDisplayableNode::OnNodeReferenceAdded" when scene is being
imported.

[1] r24393 - BUG: remove node SceneRootDir, use RootDirectory on MRML scene

Co-authored-by: Nicole Aucoin <nicole@bwh.harvard.edu>

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

mod - Libs/MRML/Core/Testing/vtkMRMLSceneImportIDConflictTest.cxx Diff File
mod - Libs/MRML/Core/Testing/vtkMRMLSceneImportIDModelHierarchyConflictTest.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLParser.cxx Diff File