Medical Imaging Interaction Toolkit  2018.4.99-e1268d66
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB
14 #define MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB
15 
16 #include "MitkCoreExports.h"
17 #include "mitkDisplayInteractor.h"
18 #include <itkObject.h>
19 
20 namespace mitk
21 {
22  /***********************************************************************
23  *
24  * \brief Class that offers a convenient way to switch between different
25  * interaction schemes
26  *
27  * This class offers the possibility to switch between the two different
28  * interaction schemes that are available:
29  * - MITK : The original interaction scheme
30  * - left mouse button : setting the cross position in the MPR view
31  * - middle mouse button : panning
32  * - right mouse button : zooming
33  *
34  *
35  * - PACS : an alternative interaction scheme that behaves more like a
36  * PACS workstation
37  * - left mouse button : behavior depends on current MouseMode
38  * - middle mouse button : fast scrolling
39  * - right mouse button : level-window
40  * - ctrl + right button : zooming
41  * - shift+ right button : panning
42  *
43  * There are 5 different MouseModes that are available in the PACS scheme.
44  * Each MouseMode defines the interaction that is performed on a left
45  * mouse button click:
46  * - Pointer : sets the cross position for the MPR
47  * - Scroll
48  * - Level-Window
49  * - Zoom
50  * - Pan
51  *
52  * When the interaction scheme or the MouseMode is changed, this class
53  * manages the adding and removing of the relevant listeners offering
54  * a convenient way to modify the interaction behavior.
55  *
56  ***********************************************************************/
57  class MITKCORE_EXPORT MouseModeSwitcher : public itk::Object
58  {
59  public:
60 #pragma GCC visibility push(default)
61 
64  itkEventMacro(MouseModeChangedEvent, itk::AnyEvent);
65 #pragma GCC visibility pop
66 
68  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
69 
70  // enum of the different interaction schemes that are available
72  PACS = 0,
73  MITK = 1,
74  ROTATION = 2,
75  ROTATIONLINKED = 3,
76  SWIVEL = 4
77  };
78 
79  // enum of available mouse modes for PACS interaction scheme
80  enum MouseMode
81  {
82  MousePointer = 0,
86  Pan
87  };
88 
92  void SetInteractionScheme(InteractionScheme);
93 
97  void SelectMouseMode(MouseMode mode);
98 
102  MouseMode GetCurrentMouseMode() const;
103 
104  protected:
106  ~MouseModeSwitcher() override;
107 
108  private:
112  void InitializeListeners();
113 
114  InteractionScheme m_ActiveInteractionScheme;
115  MouseMode m_ActiveMouseMode;
116  DisplayInteractor::Pointer m_CurrentObserver;
117 
123  };
124 } // namespace mitk
125 
126 #endif /* MITKMouseModeSwitcher_H_HEADER_INCLUDED_C10DC4EB */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
itkEventMacro(ContourModelEvent, itk::AnyEvent)