Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMouseModeSwitcher.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB
18 #define MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB
19 
20 #include "MitkCoreExports.h"
21 #include "mitkDisplayInteractor.h"
22 #include <itkObject.h>
23 
24 namespace mitk
25 {
26  /***********************************************************************
27  *
28  * \brief Class that offers a convenient way to switch between different
29  * interaction schemes
30  *
31  * This class offers the possibility to switch between the two different
32  * interaction schemes that are available:
33  * - MITK : The original interaction scheme
34  * - left mouse button : setting the cross position in the MPR view
35  * - middle mouse button : panning
36  * - right mouse button : zooming
37  *
38  *
39  * - PACS : an alternative interaction scheme that behaves more like a
40  * PACS workstation
41  * - left mouse button : behavior depends on current MouseMode
42  * - middle mouse button : fast scrolling
43  * - right mouse button : level-window
44  * - ctrl + right button : zooming
45  * - shift+ right button : panning
46  *
47  * There are 5 different MouseModes that are available in the PACS scheme.
48  * Each MouseMode defines the interaction that is performed on a left
49  * mouse button click:
50  * - Pointer : sets the cross position for the MPR
51  * - Scroll
52  * - Level-Window
53  * - Zoom
54  * - Pan
55  *
56  * When the interaction scheme or the MouseMode is changed, this class
57  * manages the adding and removing of the relevant listeners offering
58  * a convenient way to modify the interaction behavior.
59  *
60  ***********************************************************************/
61  class MITKCORE_EXPORT MouseModeSwitcher : public itk::Object
62  {
63  public:
64 #pragma GCC visibility push(default)
65 
68  itkEventMacro(MouseModeChangedEvent, itk::AnyEvent);
69 #pragma GCC visibility pop
70 
72  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
73 
74  // enum of the different interaction schemes that are available
76  PACS = 0,
77  MITK = 1,
78  ROTATION = 2,
79  ROTATIONLINKED = 3,
80  SWIVEL = 4
81  };
82 
83  // enum of available mouse modes for PACS interaction scheme
84  enum MouseMode
85  {
86  MousePointer = 0,
90  Pan
91  };
92 
96  void SetInteractionScheme(InteractionScheme);
97 
101  void SelectMouseMode(MouseMode mode);
102 
106  MouseMode GetCurrentMouseMode() const;
107 
108  protected:
110  virtual ~MouseModeSwitcher();
111 
112  private:
116  void InitializeListeners();
117 
118  InteractionScheme m_ActiveInteractionScheme;
119  MouseMode m_ActiveMouseMode;
120  DisplayInteractor::Pointer m_CurrentObserver;
121 
127  };
128 } // namespace mitk
129 
130 #endif /* MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
itkEventMacro(ContourModelEvent, itk::AnyEvent)