The purpose of this post is to frame the discussion around improving the exposure of vtkSlicerModuleLogics to other Slicer components (e.g., displayable managers). After having a look at the code, my understanding of the current situation is as follows:
- Each
vtkSlicerModuleLogicis created and kept by its correspondingqSlicerModule, as a member variable. - A logic object can be obtained by the
qSlicerAbstractCoreModule::logic()method orqSlicerAbstractModuleRepresentation::logic()(for module widgets). -
vtkSlicerModuleLogics are very flexible components and it is desirable that they can be more easily exposed to other components (possibly in other modules).
The plan for improving the exposure of vtkSlicerModuleLogics could be as follows:
- Keeping an association between
qSlicerModules andvtkSlicerModuleLogics invtkMRMLApplicationLogic, which is a more reachable component. - Remove
qSlicerAbstractCoreModule::logic()andqSlicerAbstractModuleRepresentation::logic(). For consistency, the only way to access the module logics will bevtkMRMLApplicationLogic::GetModuleLogic(const char* moduleName). - Lifecycle of
vtkSlicerModuleLogics will still be managed byqSlicerModules. There will be only 1 logic per module.
@lassoan, @jcfr, @pieper, does it look to you like a good course of action?