Page MenuHomePhabricator

Add a second style of mouse interaction to CoreApp
Closed, ResolvedPublic

Description

There are already a couple of interactors/state machines that could be used to provide a different style of mouse interaction to CoreApp/ExtApp. We want to

  • allow the user to select one of two interaction schemes (MITK/PACS) via application preferences.
  • MITK scheme (as before):
    • left button: center MPR here
    • middle button: pan
    • right button: zoom
    • CTRL + left button: some other interactions e.g. for point sets
  • PACS scheme (new):
    • left button: one of
      • center MPR here
      • zoom
      • pan
      • level / window
      • scroll sclies
    • middle button: scroll slices (w/ mouse up / down)
    • right button: level / window (w/ mouse up/down, left/right)
    • Shift + right button: pan
    • CTRL + right button: zoom
  • a small toolbar widget will be provided for GUI inclusion (user selection of left button action)

Logic to change schemes and current interactors/listeners will be encapsulated in a class mitk::MouseModeSwitcher.
Necessary communication with QmitkStdMultiWidget will be limited to the QmitkStdMultiWidget observing this class and acting passively.
QmitkMouseModeSwitcher(GUI?) will implement a QToolBar with a couple of buttons and communicate with mitk::MouseModeSwitcher.
New logic and GUI class will be instantiated and coupled with QmitkStdMultiWidget by the container which currently creates the QmitkStdMultiWidget. Specific instantiation of the toolbar widget will be discussed with Sascha/Michi.

Attached is a poor quality / high efficiency sketch of classes and implementation hints (German).

interaction.png (1×722 px, 26 KB)

Related Objects

StatusAssignedTask
ResolvedNone
ResolvedNone

Event Timeline

After short code inspection and telephone call to Marco/Michi we decided on a minor change:

The tool selection buttons shall appear in a small vertical column left of the four render windows. This also simplifies implementation to a single class where all new things will get created/connectd:

Instantiation of QmitkStdMultiWidget in CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditor.cpp

I implemented a basic toolbar as described in previous comment. Necessary communication with the non-GUI class MosueModeSwitcher are prepared as far as possible. Icons are not perfect but this must be changed by somebody else for consistency with the other icons.

Markus, if anything more is needed, please tell me.

Before integrating my changes, could you please check whether I broke the margins of multi-widget? Looks much to broad..

The new class mitkMouseModeSwitcher has been implemented.
It's possible to switch between the two interaction schemes (MITK/PACS) by calling SetInteractionScheme(...).

If the PACS scheme is active, it's possible to set the desired interaction for left mouse button clicks by calling SelectMouseMode( MouseMode ).

The interaction behaviour has been implemented as described in the bug-description.

We just checked and tested the code to remove last issues. Now everything is working except two minor issues, which Markus will correct:

  1. MouseModeSwitcher should implement a New() method as all ITK objects (also should be used in QmitkStdMultiWidget)
  1. LevelWindow-Tool on left mouse button produces error logs on commandline:

#8.070# [StateMachine] ERROR: Error in mitkStateMachine.cpp: StateMachine not initialized with the right temporal information!

All else is fine

Last issues fixed now (Markus and me).

Awaiting comments by Marco before merging.

Code can be tested in branch bug-10371-new-mouse-modes-clean ("-clean" is important, other branch of similar name contains unintended commits)

Would the new vertical tool bar a place for the render window menu too? This would probably solve a lot of issues concerning these top-level windows. For example T10420

(In reply to comment #10)

Would the new vertical tool bar a place for the render window menu too? This
would probably solve a lot of issues concerning these top-level windows. For
example T10420

I think some of the actions in the render window menus are correctly put there, because they relate to one window. We should rather implement them correctly or without Qt.

Ah okay. I first thought each render window will have it's own vertical toolbar.

[187e51]: Merge branch 'bug-10371-new-mouse-modes-clean'

Merged commits:

2011-12-08 17:11:33 Daniel Maleike [8ec958]
Correct Doxygen code


2011-12-08 17:05:15 Daniel Maleike [d2c1ef]
Don't waste precious pixels


2011-12-08 16:52:51 Daniel Maleike [f408e5]
Remove obsolete code


2011-12-08 16:48:29 Daniel Maleike [a68412]
Disable debug output


2011-12-08 16:00:54 Daniel Maleike [5f71fe]
Document event


2011-12-08 16:20:32 Markus Engel [393b11]
using itkSmartPointer for mouseModeSwticher & renaming enum element


2011-12-08 16:06:53 Markus Engel [231bd5]
added missing line in statemachine.xml


2011-12-08 15:58:49 Markus Engel [787137]
adding additional statemachine for levelwindowing with left mouse button


2011-12-08 15:52:07 Daniel Maleike [81e5d0]
Reset tools when different plane rotation modes are activated (avoids chaotic behavior)


2011-12-08 15:51:37 Daniel Maleike [2136b3]
Observe mitk:MouseModeSwitcher for changes and update button state accordingly


2011-12-08 15:51:08 Daniel Maleike [0fb18c]
Actually change interaction scheme


2011-12-08 15:50:21 Daniel Maleike [3a5863]
Actually update the active mouse mode member variable


2011-12-08 15:50:10 Daniel Maleike [051415]
Also observe property that is selected by LW manager itself


2011-12-08 14:51:14 Daniel Maleike [109d46]
add assert, rename m_ActiveListener to m_LeftMouseButtonHandler


2011-12-08 14:50:49 Daniel Maleike [18174c]
Make documentation style more consistent


2011-12-08 13:29:52 Markus Engel [3a8b4c]
correctly setting up mousemodeswitcher for StdMultiWidget


2011-12-08 13:26:23 Markus Engel [98e9e3]
removing unnecessary code


2011-12-08 13:26:04 Markus Engel [3e6833]
adding class documentation for mousemodeswitcher


2011-12-08 11:41:09 Markus Engel [ae6f37]
using MouseModeSwitcher instead of MoveAndZoomInteractor


2011-12-08 11:40:06 Markus Engel [ed0614]
updating rendering after interaction, renaming method


2011-12-08 11:39:20 Markus Engel [86687c]
setting property for levelWindow editing on correct node


2011-12-08 11:38:52 Markus Engel [d9f5e7]
using correct enum instead of int


2011-12-08 11:37:56 Markus Engel [109bcb]
initial commit of mitkMouseModeSwitcher


2011-12-08 09:36:05 Daniel Maleike [f114a6]
Make slot public and document it


2011-12-08 09:35:55 Daniel Maleike [469594]
Call setInteractionScheme on correct object


2011-12-07 20:17:31 Daniel Maleike [84a22b]
Add icons for mouse modes -- strongly inspired by Slicer 4


2011-12-07 20:17:14 Daniel Maleike [767e1e]
Add QmitkMouseModeSwitcher, which is shown only by preference.

User preference "PACS like mouse interaction" was added. When
active the new toolbar is shown, otherwise hidden.

Toolbar will change interaction behavior by a non-GUI class
mitk::MouseModeSwitcher, which still needs to be implemented.

Just merged changed into master and will keep an eye on the MITK dashboard

The changes

http://mitk.org/git/?p=MITK.git;a=commitdiff;h=05141565fbe7df618626569d0af54a616e0c025a

http://mitk.org/git/?p=MITK.git;a=commitdiff;h=86687c4d22e86c213334f36c1ad553159254b343

introduced with this branch lead to strange beahviour regarding the LevelWindow.

See user mail

http://sourceforge.net/mailarchive/forum.php?thread_name=CF6E9FDF-8E0F-4819-A686-1CBBD1BA1559%40live.ucl.ac.uk&forum_name=mitk-users

for more details

[52355a]: Merge branch 'bug-10371-new-mouse-modes'

Merged commits:

2012-02-08 18:27:09 Daniel Maleike [b8211d]
Do not change m_AutoTopMost just because someone asks to observe a special property


2012-02-08 18:25:50 Daniel Maleike [d63f91]
Format code more nicely


2011-12-08 17:05:15 Daniel Maleike [cecc4b]
Don't waste precious pixels


2011-12-08 16:52:51 Daniel Maleike [138a57]
Remove obsolete code


2011-12-08 16:48:29 Daniel Maleike [9c17f6]
Disable debug output


2011-12-08 16:00:54 Daniel Maleike [d31507]
Document event


2011-12-08 16:20:32 Markus Engel [4afa08]
using itkSmartPointer for mouseModeSwticher & renaming enum element


2011-12-08 16:06:53 Markus Engel [4c1e02]
added missing line in statemachine.xml


2011-12-08 15:58:49 Markus Engel [c12579]
adding additional statemachine for levelwindowing with left mouse button


2011-12-08 15:52:07 Daniel Maleike [2b8b97]
Reset tools when different plane rotation modes are activated (avoids chaotic behavior)


2011-12-08 15:51:37 Daniel Maleike [4b218e]
Observe mitk:MouseModeSwitcher for changes and update button state accordingly


2011-12-08 15:51:08 Daniel Maleike [2dd118]
Actually change interaction scheme


2011-12-08 15:50:21 Daniel Maleike [502a0a]
Actually update the active mouse mode member variable


2011-12-08 15:50:10 Daniel Maleike [a6a398]
Also observe property that is selected by LW manager itself


2011-12-08 14:51:14 Daniel Maleike [b4d8d0]
add assert, rename m_ActiveListener to m_LeftMouseButtonHandler


2011-12-08 14:50:49 Daniel Maleike [923728]
Make documentation style more consistent


2011-12-08 14:28:40 Daniel Maleike [adaa9e]
Merge branch 'bug-10371-new-mouse-modes' of mitk.org:MITK into bug-10371-new-mouse-modes


2011-12-08 14:28:01 Daniel Maleike [407a88]
DIREY

[8e5a77]: Merge branch 'bug-10371-new-mouse-modes'

Merged commits:

2012-02-10 16:46:50 Alexander Seitel [d8c945]
COMP: use correct class name

kislinsk reopened subtask Restricted Maniphest Task as Open.Jun 27 2018, 3:00 PM
kislinsk closed subtask Restricted Maniphest Task as Resolved.Jun 27 2018, 3:27 PM