Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
Medical Imaging Interaction Toolkit
mitkInteractionEvent.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 MITKINTERACTIONEVENT_H_
14 #define MITKINTERACTIONEVENT_H_
15 
16 #include "itkLightObject.h"
17 #include "itkObjectFactory.h"
18 #include "mitkBaseRenderer.h"
19 #include "mitkCommon.h"
20 
21 #include <MitkCoreExports.h>
22 #include <string>
23 
24 namespace mitk
25 {
26  class MITKCORE_EXPORT InteractionEvent : public itk::LightObject
27  {
28  public:
31 
32  void SetSender(BaseRenderer *sender);
33  BaseRenderer *GetSender() const;
34 
39  virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const;
40 
45  {
46  NoButton = 0x0000,
47  LeftMouseButton = 0x0001,
48  RightMouseButton = 0x0002,
49  MiddleMouseButton = 0x0004
50  };
51 
53  {
54  NoKey = 0x0000,
55  ShiftKey = 0x0100,
56  ControlKey = 0x0200,
57  AltKey = 0x0400
58  };
59 
63  // Special Keys
64  static const std::string KeyEsc; // = "Escape";
65  static const std::string KeyEnter; // = "Enter";
66  static const std::string KeyReturn; // = "Return";
67  static const std::string KeyDelete; // = "Delete";
68  static const std::string KeyArrowUp; // = "ArrowUp";
69  static const std::string KeyArrowDown; // = "ArrowDown";
70  static const std::string KeyArrowLeft; // = "ArrowLeft";
71  static const std::string KeyArrowRight; // = "ArrowRight";
72 
73  static const std::string KeyF1; // = "F1";
74  static const std::string KeyF2; // = "F2";
75  static const std::string KeyF3; // = "F3";
76  static const std::string KeyF4; // = "F4";
77  static const std::string KeyF5; // = "F5";
78  static const std::string KeyF6; // = "F6";
79  static const std::string KeyF7; // = "F7";
80  static const std::string KeyF8; // = "F8";
81  static const std::string KeyF9; // = "F9";
82  static const std::string KeyF10; // = "F10";
83  static const std::string KeyF11; // = "F11";
84  static const std::string KeyF12; // = "F12";
85 
86  static const std::string KeyPos1; // = "Pos1";
87  static const std::string KeyEnd; // = "End";
88  static const std::string KeyInsert; // = "Insert";
89  static const std::string KeyPageUp; // = "PageUp";
90  static const std::string KeyPageDown; // = "PageDown";
91  static const std::string KeySpace; // = "Space";
92  // End special keys
93 
94  protected:
96  ~InteractionEvent() override;
97 
98  friend MITKCORE_EXPORT bool operator==(const InteractionEvent &, const InteractionEvent &);
99  virtual bool IsEqual(const InteractionEvent &other) const;
100 
101  private:
102  BaseRenderer *m_Sender;
103  };
104 
116 
117  /*
118  * Allow bitwise OR operation on enums.
119  */
121  {
122  return static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
123  }
124 
127  {
128  a = static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
129  return a;
130  }
131 
133  {
134  return static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
135  }
136 
139  {
140  a = static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
141  return a;
142  }
143 
144 } /* namespace mitk */
145 
146 #endif /* MITKINTERACTIONEVENT_H_ */
static const std::string KeyF1
static const std::string KeyF12
static const std::string KeyF9
static const std::string KeyF4
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
#define MITKCORE_EXPORT
static const std::string KeyPos1
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
static const std::string KeyF10
static const std::string KeyEsc
static const std::string KeyArrowLeft
static const std::string KeySpace
InteractionEvent::MouseButtons & operator|=(InteractionEvent::MouseButtons &a, InteractionEvent::MouseButtons &b)
InteractionEvent::MouseButtons operator|(InteractionEvent::MouseButtons a, InteractionEvent::MouseButtons b)
Organizes the rendering process.
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string KeyEnd
static const std::string KeyArrowRight
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
static const std::string KeyEnter
static const std::string KeyF7
static const std::string KeyArrowDown
static const std::string KeyF2
static const std::string KeyF11
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
static const std::string KeyInsert
static const std::string KeyDelete
static const std::string KeyF5
static const std::string KeyF6
static const std::string KeyF3
static const std::string KeyF8
static const std::string KeyPageDown
static const std::string KeyReturn
static const std::string KeyArrowUp
static const std::string KeyPageUp