View Issue Details

IDProjectCategoryView StatusLast Update
0004078Slicer4Core: MRMLpublic2017-09-26 10:36
ReporterjcfrAssigned Tojcfr 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version 
Target VersionbacklogFixed in Version 
Summary0004078: vtkMRMLNode::CopyWithScene is broken if called after the copied node has been added to the scene
Description

Calling CopyWithScene after the copied node has been added
to the scene will be problematic. In that case, (a) the source
and copied node will end up having the same ID and (b) the scene
cache and reference list won't be up-to-date either.

This is explained because the method CopyWithScene systematically
copy the nodeID from the source node without asking the scene
to generate a new one if the scene is set.

TagsNo tags attached.

Activities

jcfr

jcfr

2015-11-10 01:15

administrator   ~0013580

Test with failing cases commented out has been added in r24718
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24718

Possible mitigation:

  • Change MRMLNode::GetID() to be protected.

  • Update vtkMRMLNode::CopyWithScene to ask the scene for a new ID if one
    is already set on the copied node.

Related Changesets

Import 2017-06-07 23:51:09: master 4d20888b

2015-11-10 05:35:36

jcfr

Details Diff
STYLE: MRMLNodeTest1: Add test for CopyWithScene() node method. See 0003462

It allowed to identify the following unsupported case:

Calling CopyWithScene after the copied node has been added
to the scene will be problematic. In that case, (a) the source
and copied node will end up having the same ID and (b) the scene
cache and reference list won't be up-to-date either.

This is explained because the method CopyWithScene systematically
copy the nodeID from the source node without asking the scene
to generate a new one if the scene is set.

Issue 0004078 has been created to keep track of the problem.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24718 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/Testing/vtkMRMLNodeTest1.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLNode.h Diff File

Issue History

Date Modified Username Field Change
2015-11-10 00:24 jcfr New Issue
2015-11-10 00:24 jcfr Status new => assigned
2015-11-10 00:24 jcfr Assigned To => alexy
2015-11-10 01:15 jcfr Note Added: 0013580
2015-11-10 01:15 jcfr Assigned To alexy => jcfr
2015-11-10 01:15 jcfr Target Version => Slicer 4.5.1
2016-10-12 02:56 jcfr Target Version Slicer 4.5.1 => Slicer 4.7.0
2017-06-10 08:51 jcfr Changeset attached => Slicer master 4d20888b
2017-09-26 10:36 jcfr Target Version Slicer 4.7.0 => backlog