The purpose of this post is to frame the discussion around improving the exposure of vtkSlicerModuleLogic
s 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
vtkSlicerModuleLogic
is 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). -
vtkSlicerModuleLogic
s 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 vtkSlicerModuleLogic
s could be as follows:
- Keeping an association between
qSlicerModule
s andvtkSlicerModuleLogic
s 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
vtkSlicerModuleLogic
s will still be managed byqSlicerModule
s. There will be only 1 logic per module.
@lassoan, @jcfr, @pieper, does it look to you like a good course of action?