Page MenuHomePhabricator

Rework QmitkMouseModeSwitcher
Closed, ResolvedPublic

Description

  • changing the mouse mode via the buttons in the mouse mode toolbar (PACS-like mode in StdMultiWidget) results in a call of 'OnMouseModeChanged'
    • this happens, since the command observes the 'MouseModeChangedEvent' event of mouse mode switcher and calls 'OnMouseModeChanged'; changing the mouse mode via the buttons in the mouse mode toolbar leads to the mouse mode switcher invoking the 'MouseModeChangedEvent' event.
    • 'OnMouseModeChanged' is even called twice, since both functions 'SetInteractionScheme' and 'SelectMouseMode' of the 'mitkMouseModeSwitcher'-class invoke the event
  • the 'OnMouseModeChanged'-function inside the 'QmitkMouseModeSwitcher' emits the 'MouseModeSelected'-signal; this signal is never used anywhere
  • a bool variable is used to block the slot from being called when the action button check state is changed; could simply use qt block mechanism to do this (if any blocking is needed?)

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

kalali triaged this task as Normal priority.Mar 7 2018, 5:18 PM
kalali created this task.
kalali removed kalali as the assignee of this task.Nov 5 2018, 9:33 AM

A new class, the QmitkInteractionSchemeToolBar has already been introduced in 9ab09bff137b. This class is used as a replacement for the QmitkMouseModeSwitcher. It it a simplified version which does not observe the mouse mode switcher / interaction scheme switcher. There is no observer tag and no block-functionality.
Additionally, the tool bar is adjusted to match the new InteractionSchemeSwitcher (see T24357): There is no difference anymore between a mouse mode and an interaction scheme (see T24368).
The new toolbar is used for the mxnmulwiwidgeteditor and is currently tested with the stdmultiwidgeteditor (see 732f754ad203).

Has been solved on top of T26476.
This task will be closed if everything is merged to master and tested (wait for D212).

This task / branch was never merged into master; the mentioned BlackSwan task T26476 is still not contained in master / develop.
For reasons of cleanliness I will open a new branch / differential containing just the changes related to this task such that we can merge the new branch into develop and close this task.
@s434n will help me evaluate the relevance / validity of the changes.

kalali added a revision: Restricted Differential Revision.Aug 25 2021, 11:57 AM
kalali added a revision: Restricted Differential Revision.Sep 19 2021, 6:28 PM
kalali added a revision: Restricted Differential Revision.Oct 4 2021, 8:22 AM
kislinsk reopened this task as Open.EditedOct 15 2021, 7:19 AM
kislinsk raised the priority of this task from Normal to Unbreak Now!.
kislinsk added a subscriber: kislinsk.

This is a good candidate for some XML parsing errors that we see in the latest develop version of the MitkWorkbench, For example, activate any 3D segmentation tool and look at the console output:

vtkXMLParser.cxx:379 ERR| vtkXMLParser (0000027698218908): Error parsing XML in stream at line 1, column 0, byte index -1: no element found

It starts with line 162 in mitkTool.cpp (last code line in snippet):

auto displayActionEventBroadcast = dynamic_cast<DisplayActionEventBroadcast*>(us::GetModuleContext()->GetService<InteractionEventObserver>(*it));
if (displayActionEventBroadcast != nullptr)
{
  // remember the original configuration
  m_DisplayInteractorConfigs.insert(std::make_pair(*it, displayActionEventBroadcast->GetEventConfig()));
  // here the alternative configuration is loaded
  displayActionEventBroadcast->AddEventConfig(m_EventConfig.c_str()); // line 162, m_EventConfig is an empty string
}

I guess m_EventConfig is not supposed to be an empty string. Or, if it is supposed to be an empty string, AddEventConfig() should probably handle it gracefully, before the vtkXMLParser has the chance to complain.

This is a good candidate for some XML parsing errors that we see in the latest develop version of the MitkWorkbench, For example, activate any 3D segmentation tool and look at the console output:

vtkXMLParser.cxx:379 ERR| vtkXMLParser (0000027698218908): Error parsing XML in stream at line 1, column 0, byte index -1: no element found

It starts with line 162 in mitkTool.cpp (last code line in snippet):

auto displayActionEventBroadcast = dynamic_cast<DisplayActionEventBroadcast*>(us::GetModuleContext()->GetService<InteractionEventObserver>(*it));
if (displayActionEventBroadcast != nullptr)
{
  // remember the original configuration
  m_DisplayInteractorConfigs.insert(std::make_pair(*it, displayActionEventBroadcast->GetEventConfig()));
  // here the alternative configuration is loaded
  displayActionEventBroadcast->AddEventConfig(m_EventConfig.c_str()); // line 162, m_EventConfig is an empty string
}

I guess m_EventConfig is not supposed to be an empty string. Or, if it is supposed to be an empty string, AddEventConfig() should probably handle it gracefully, before the vtkXMLParser has the chance to complain.

Thanks for the observation / hint. I guess this is related to D531 and T28667 resp.
For the 3D segmentation tool no interaction event is added. This is typically only used to block the left mouse button, e.g. for "Add", "Paint" etc.
So the default event was set to empty. I will fix this is the mentioned task.

Deleted branch from rMITK MITK: T24358-Remove-QmitkMouseModeSwitcher.