3462 model maker breaks slice view display
Created by: jcfr
BUG: Avoid confusion when importing scene model hierarchy. Fixes #3462
*** WIP ***
Considering that:
- the slice view representation in the 3D view is done using a
vtkMRMLModelDisplayNode
- the IDs associated with these nodes are
vtkMRMLModelDisplayNode1
,vtkMRMLModelDisplayNode2
, ... - node references are updated after nodes are added to the scene. Indeed, this is done in the
UpdateNodeReferences()
function called fromvtkMRMLScene::Import()
- By default,
qMRMLSceneDisplayableModel
updates itself each time a node is added (NodeAddedEvent
), it doesn't consider the Import state of the scene.
importing a scene containing hierarchy nodes referencing model display nodes also identified with vtkMRMLModelDisplayNode1
, ... will cause the qMRMLSceneDisplayableModel
to
This commit implements the solution consisting in always setting the qMRMLSceneDisplayableModel
as LazyUpdate, this means that To be continued
(a) the model will always ignore the NodeAdded/NodeRemoved events when batch operation (ie Import) are done on the scene
and (b) will rescan the scene after the batch operation is complete.