VTK  9.0.1
vtkEvent.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEvent.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkEvent_h
24 #define vtkEvent_h
25 
26 #include "vtkInteractionWidgetsModule.h" // For export macro
27 #include "vtkObject.h"
28 
30 
31 class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
32 {
33 public:
37  static vtkEvent* New();
38 
40 
43  vtkTypeMacro(vtkEvent, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
52  {
53  AnyModifier = -1,
54  NoModifier = 0,
55  ShiftModifier = 1,
56  ControlModifier = 2,
57  AltModifier = 4
58  };
59 
61 
64  vtkSetMacro(EventId, unsigned long);
65  vtkGetMacro(EventId, unsigned long);
67 
69 
72  vtkSetMacro(Modifier, int);
73  vtkGetMacro(Modifier, int);
75 
77 
80  vtkSetMacro(KeyCode, char);
81  vtkGetMacro(KeyCode, char);
83 
85 
88  vtkSetMacro(RepeatCount, int);
89  vtkGetMacro(RepeatCount, int);
91 
93 
96  vtkSetStringMacro(KeySym);
97  vtkGetStringMacro(KeySym);
99 
103  static int GetModifier(vtkRenderWindowInteractor*);
104 
109  bool operator==(vtkEvent*);
110  bool operator==(unsigned long VTKEvent); // event with no modifiers
111 
112 protected:
113  vtkEvent();
114  ~vtkEvent() override;
115 
116  unsigned long EventId;
117  int Modifier;
118  char KeyCode;
120  char* KeySym;
121 
122 private:
123  vtkEvent(const vtkEvent&) = delete;
124  void operator=(const vtkEvent&) = delete;
125 };
126 
127 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
int RepeatCount
Definition: vtkEvent.h:119
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
EventModifiers
Ways to specify modifiers to VTK events.
Definition: vtkEvent.h:51
char KeyCode
Definition: vtkEvent.h:118
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:33
char * KeySym
Definition: vtkEvent.h:120
int Modifier
Definition: vtkEvent.h:117
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:31
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
unsigned long EventId
Definition: vtkEvent.h:116