Page MenuHomePhabricator

ToolManager reloads display configuration on tool deactivation
Closed, ResolvedPublic

Description

When a segmentation tool is activated, the display interactor is disabled. The interactor is re-enabled when the tool is switched off. The principle is good, but the implementation assumes that the MITK display (stdmultiwidgeteditor) is used, and this causes problems for us.

We have a custom editor with a different display interactor. We also want to overwrite the display interactor statemachine configuration at tool activation, but with one that works with our interactor, obviously. The problem is that saving and restoring the configuration is done in mitk::ToolManager::ActivateTool, that offers no way to override. Moreover, ActivateTool restores the configuration after it calls Tool::Activate, so it is not possible to override what it did from a derived class function.

I want to propose a patch that moves this logic to mitk::Tool::Activated / Deactivated, so that the implementations could override it.

Event Timeline

User eisenman has pushed new remote branch:

bug-19467-ToolManagerDisplayConfiguration

The pull request is ready to be merged.
Applying this patch also fixes T19578.

This pull request will change the crosshair behaviour: Crosshair moves during contouring process.

Needs to be fixed of course. :)

That is weird. How can it be?

At the moment, there is one hard-coded configuration for all tools, i.e. the one that is set in the Tool::Activated method. This can be fixed by a configuration member which can be modified by the according tool subclasses.
To this end, we have set the "DisplayConfigMITK" configuration as a default setting in the Tool-class, and the "DisplayConfigMITKNoCrosshair" configuration for all 2D tools.

[1bb183]: Merge branch 'bug-19467-ToolManagerDisplayConfiguration'

Merged commits:

2016-03-30 14:33:03 Tobias Norajitra [0b4262]
Style changes.


2016-03-30 14:19:10 Tobias Norajitra [290a2a]
Block crosshair for 2D segmentation tools.


2016-03-30 14:18:41 Tobias Norajitra [c50cad]
Enable subclass to set event config individually.


2016-03-10 12:47:57 Matthias Eisenmann [9a8f91]
clean-up code


2015-12-07 20:53:10 Miklos Espak [0261d8]
Call superclass Activated/Deactivated from derived tools

Signed-off-by: Miklos Espak <m.espak@ucl.ac.uk>
Signed-off-by: Matthias Eisenmann <m.eisenmann@dkfz-heidelberg.de>


2015-12-07 20:48:42 Miklos Espak [9bbaa1]
Display interactor configuration save/restore moved to mitk::Tool

The state machine configuration of the display interactor was overwritten
by a dummy one when a tool was activated, so that there its interactions do
not conflict with the interactions of the tool. The original configuration
was restored when the tool was switched off.

This change moves this logic to mitk::Tool so that custom tools can override
what configuration should be loaded when they are active.

Signed-off-by: Miklos Espak <m.espak@ucl.ac.uk>
Signed-off-by: Matthias Eisenmann <m.eisenmann@dkfz-heidelberg.de>