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

Author Committer Branch Timestamp Parent
pinter pinter master 2014-12-09 10:35:55 master ce687194
Affected Issues 0003911: Toggle hierarchy visibility causes crash
Changeset

BUG: Fix mixing subject hierarchy with other hierarchies

Two fixes have been applied. One is to enforce nested associations if there is a conflict of two hierarchy nodes associating to one data node.
Reminder: Nested associations prevent the scenario when two hierarchy nodes associate to the same data node, which leads to non-determinism if GetAssociatedHierarchyNode is called. In this case instead of the connections (SH --assoc--> Model <--assoc-- ModelHierarchy), this structure is created: SH --assoc--> ModelHierarchy --assoc--> Model
The other fix is to ensure reparenting to the same type of hierarchy nodes. If this proves to be too strict, then we may allow reparenting to base classes, or the alternative is to subclass the scene hierarchy model to the hierarchy types.

Also a subject hierarchy bug was fixed that occurred because the widget was created when instantiating the module (which is udesirable by itself), and this caused creation of context menu actions before external plugins had the chance to register. Now the widget is not created early, but the right connections are made at the right time.

Fixes 0003911

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

mod - Libs/MRML/Widgets/qMRMLSceneHierarchyModel.cxx Diff File
mod - Modules/Loadable/SubjectHierarchy/Widgets/qMRMLSubjectHierarchyTreeView.cxx Diff File
mod - Modules/Loadable/SubjectHierarchy/Widgets/qMRMLSubjectHierarchyTreeView.h Diff File
mod - Modules/Loadable/SubjectHierarchy/qSlicerSubjectHierarchyModule.cxx Diff File
mod - Modules/Loadable/SubjectHierarchy/qSlicerSubjectHierarchyModuleWidget.cxx Diff File
mod - Modules/Loadable/SubjectHierarchy/qSlicerSubjectHierarchyModuleWidget.h Diff File