Page MenuHomePhabricator

ToolManagerProvider as Micro Service
Closed, ResolvedPublic

Description

Create a provider for ToolManager instance to have a singleton of the ToolManager class in segmentation plugin.
Delete ToolManager member from Segmentation Widgets (ToolSelectionBox). The 2D associated ToolSelctionBox is one where the current ToolManager instance for Segmentation plugin is coming from. Use a service call instead.
This service will be necessary with for the update to current interaction concept of MITK (see T14943).

Event Timeline

New remote branch pushed: bug-15828-TooManagerProvider

I have introduced a module activator (mitk::SegmentationModuleActivator) that registers services for the Segmentation Module. It now registers a ToolManagerProvider service that can be called to get an instance of mitk::ToolManager. As the service itself is a singleton there will be only one object of ToolManager. So if the service is used within Segmentation plugin it is ensured that everybody uses the instance.

The implementation of ToolManager remains the same despite an additional method that initializes the all Tools by itkObjectFactory. Previously this was only done in constructor. There is an issue the instantiation of ToolManagerProvider and ToolManager in SegmentationModuleActivator because the GlobalInteraction isn't initialized that early. The InitializeTools() method is now called in QmitkSegmentationView::CreateQtPartControll(QWidget*).

Note:
This only affects the use of ToolManager within Segmentation plugin, nothing will be changed in ToolManager class. There will also be no changes to the current interaction implementation (Tool framework). The migration will be done with T14943.

New remote branch pushed: bug-15828-ToolManagerProvider-integration

[2902dc]: Merge branch 'bug-15828-ToolManagerProvider-integration'

Merged commits:

2013-08-23 13:34:57 Tobias Schroeder [ddb1fa]
Fix namespace.

Use us::XX.


2013-08-23 13:34:15 Tobias Schroeder [5089e0]
Fix includes.


2013-08-23 13:31:32 Tobias Schroeder [385871]
Adapt files.cmake of SegmentationTestDriver.

Variable EXECUTABLE is no longer supported.


2013-08-23 13:01:42 Tobias Schroeder [dc0fcf]
Merge branch 'bug-15828-TooManagerProvider' into bug-15828-ToolManagerProvider-integration

Conflicts:
Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp


2013-08-13 13:38:21 Tobias Schroeder [38de0f]
Support old code.


2013-08-13 13:19:25 Tobias Schroeder [d243f9]
Clean up documentation.


2013-08-13 12:44:49 Tobias Schroeder [714926]
No instances of ToolManagerProvider.

Should only be created by SegmentationModuleActivator.


2013-08-13 12:24:10 Tobias Schroeder [653aa6]
Use service in all selection boxes.


2013-08-13 12:18:31 Tobias Schroeder [de891c]
Documentation


2013-08-13 12:17:41 Tobias Schroeder [39622f]
GlobalInteraction init not needed.


2013-08-13 12:16:46 Tobias Schroeder [3d3281]
Do not init Tools in constructor.

The GlobalInteraction might not have been initialized.


2013-08-13 11:30:58 Tobias Schroeder [3e67a6]
Use service call in view classes.


2013-08-13 11:30:30 Tobias Schroeder [a3a671]
Documentation of provider service.


2013-08-12 14:46:16 Tobias Schroeder [189de8]
Testing provider.


2013-08-12 14:28:42 Tobias Schroeder [93a6b5]
ToolManagerProvider as singleton.


2013-08-12 13:42:48 Tobias Schroeder [5c1c73]
changed to US API free call


2013-08-12 11:21:01 Tobias Schroeder [25e504]
Added provider service files.


2013-08-12 11:00:57 Tobias Schroeder [479d7d]
Added module activator.

Registers services for segmentation module.