Slicer: 2145-support-for-installing-extension-from-file 121af10b

Author Committer Branch Timestamp Parent
jcfr jcfr 2145-support-for-installing-extension-from-file 2013-10-31 00:51:11 2145-support-for-installing-extension-from-file 6b31883f
Changeset

ENH: Optimized performance of observations management in vtkMRMLScene

Use a std::map< std::string, std::set<std::string> > instead of two
separate ReferencedIDs and ReferencingNodes vectors to make lookup,
insertion, and deletion much faster (especially scene close takes much
shorter time now).
Store both referenced and referring nodes by ID. It is simpler, safer,
and most of the time the node pointers were validated anyway using
scene->GetNodeFromID(node->GetID().

Also, use set instead of vector for storing unique IDs for improving
performance of scene loading (especially when the same scene is loaded
twice and a lot of IDs have to be generated).

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

From: Andras Lasso <lasso@queensu.ca>

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

mod - Libs/MRML/Core/Testing/vtkMRMLSceneViewNodeStoreSceneTest.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScene.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScene.h Diff File
mod - Libs/MRML/Core/vtkMRMLSceneViewNode.cxx Diff File
mod - Libs/MRML/Logic/vtkMRMLApplicationLogic.cxx Diff File
mod - Modules/Loadable/VolumeRendering/Logic/vtkSlicerVolumeRenderingLogic.cxx Diff File