Medical Imaging Interaction Toolkit  2016.11.0
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,
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 MITKINTERACTIONEVENT_H_
18 #define MITKINTERACTIONEVENT_H_
19 
20 #include "itkLightObject.h"
21 #include "itkObjectFactory.h"
22 #include "mitkBaseRenderer.h"
23 #include "mitkCommon.h"
24 
25 #include <MitkCoreExports.h>
26 #include <string>
27 
28 namespace mitk
29 {
30  class MITKCORE_EXPORT InteractionEvent : public itk::LightObject
31  {
32  public:
34 
35  void SetSender(BaseRenderer *sender);
36  BaseRenderer *GetSender() const;
37 
42  virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const;
43 
48  {
49  NoButton = 0x0000,
50  LeftMouseButton = 0x0001,
51  RightMouseButton = 0x0002,
52  MiddleMouseButton = 0x0004
53  };
54 
56  {
57  NoKey = 0x0000,
58  ShiftKey = 0x0100,
59  ControlKey = 0x0200,
60  AltKey = 0x0400
61  };
62 
66  // Special Keys
67  static const std::string KeyEsc; // = "Escape";
68  static const std::string KeyEnter; // = "Enter";
69  static const std::string KeyReturn; // = "Return";
70  static const std::string KeyDelete; // = "Delete";
71  static const std::string KeyArrowUp; // = "ArrowUp";
72  static const std::string KeyArrowDown; // = "ArrowDown";
73  static const std::string KeyArrowLeft; // = "ArrowLeft";
74  static const std::string KeyArrowRight; // = "ArrowRight";
75 
76  static const std::string KeyF1; // = "F1";
77  static const std::string KeyF2; // = "F2";
78  static const std::string KeyF3; // = "F3";
79  static const std::string KeyF4; // = "F4";
80  static const std::string KeyF5; // = "F5";
81  static const std::string KeyF6; // = "F6";
82  static const std::string KeyF7; // = "F7";
83  static const std::string KeyF8; // = "F8";
84  static const std::string KeyF9; // = "F9";
85  static const std::string KeyF10; // = "F10";
86  static const std::string KeyF11; // = "F11";
87  static const std::string KeyF12; // = "F12";
88 
89  static const std::string KeyPos1; // = "Pos1";
90  static const std::string KeyEnd; // = "End";
91  static const std::string KeyInsert; // = "Insert";
92  static const std::string KeyPageUp; // = "PageUp";
93  static const std::string KeyPageDown; // = "PageDown";
94  static const std::string KeySpace; // = "Space";
95  // End special keys
96 
97  protected:
99  virtual ~InteractionEvent();
100 
101  friend MITKCORE_EXPORT bool operator==(const InteractionEvent &, const InteractionEvent &);
102  virtual bool IsEqual(const InteractionEvent &other) const;
103 
104  private:
105  BaseRenderer *m_Sender;
106  };
107 
119 
120  /*
121  * Allow bitwise OR operation on enums.
122  */
124  {
125  return static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
126  }
127 
130  {
131  a = static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
132  return a;
133  }
134 
136  {
137  return static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
138  }
139 
142  {
143  a = static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
144  return a;
145  }
146 
147 } /* namespace mitk */
148 
149 #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:76
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:53
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