Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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:
30 
31  void SetSender(BaseRenderer *sender);
32  BaseRenderer *GetSender() const;
33 
38  virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const;
39 
44  {
45  NoButton = 0x0000,
46  LeftMouseButton = 0x0001,
47  RightMouseButton = 0x0002,
48  MiddleMouseButton = 0x0004
49  };
50 
52  {
53  NoKey = 0x0000,
54  ShiftKey = 0x0100,
55  ControlKey = 0x0200,
56  AltKey = 0x0400
57  };
58 
62  // Special Keys
63  static const std::string KeyEsc; // = "Escape";
64  static const std::string KeyEnter; // = "Enter";
65  static const std::string KeyReturn; // = "Return";
66  static const std::string KeyDelete; // = "Delete";
67  static const std::string KeyArrowUp; // = "ArrowUp";
68  static const std::string KeyArrowDown; // = "ArrowDown";
69  static const std::string KeyArrowLeft; // = "ArrowLeft";
70  static const std::string KeyArrowRight; // = "ArrowRight";
71 
72  static const std::string KeyF1; // = "F1";
73  static const std::string KeyF2; // = "F2";
74  static const std::string KeyF3; // = "F3";
75  static const std::string KeyF4; // = "F4";
76  static const std::string KeyF5; // = "F5";
77  static const std::string KeyF6; // = "F6";
78  static const std::string KeyF7; // = "F7";
79  static const std::string KeyF8; // = "F8";
80  static const std::string KeyF9; // = "F9";
81  static const std::string KeyF10; // = "F10";
82  static const std::string KeyF11; // = "F11";
83  static const std::string KeyF12; // = "F12";
84 
85  static const std::string KeyPos1; // = "Pos1";
86  static const std::string KeyEnd; // = "End";
87  static const std::string KeyInsert; // = "Insert";
88  static const std::string KeyPageUp; // = "PageUp";
89  static const std::string KeyPageDown; // = "PageDown";
90  static const std::string KeySpace; // = "Space";
91  // End special keys
92 
93  protected:
95  ~InteractionEvent() override;
96 
97  friend MITKCORE_EXPORT bool operator==(const InteractionEvent &, const InteractionEvent &);
98  virtual bool IsEqual(const InteractionEvent &other) const;
99 
100  private:
101  BaseRenderer *m_Sender;
102  };
103 
115 
116  /*
117  * Allow bitwise OR operation on enums.
118  */
120  {
121  return static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
122  }
123 
126  {
127  a = static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
128  return a;
129  }
130 
132  {
133  return static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
134  }
135 
138  {
139  a = static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
140  return a;
141  }
142 
143 } /* namespace mitk */
144 
145 #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