VTK  9.2.6
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 =========================================================================*/
26 #ifndef vtkEvent_h
27 #define vtkEvent_h
28 
29 #include "vtkInteractionWidgetsModule.h" // For export macro
30 #include "vtkObject.h"
31 
33 
34 class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
35 {
36 public:
40  static vtkEvent* New();
41 
43 
46  vtkTypeMacro(vtkEvent, vtkObject);
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
55  {
56  AnyModifier = -1,
57  NoModifier = 0,
58  ShiftModifier = 1,
59  ControlModifier = 2,
60  AltModifier = 4
61  };
62 
64 
67  vtkSetMacro(EventId, unsigned long);
68  vtkGetMacro(EventId, unsigned long);
70 
72 
75  vtkSetMacro(Modifier, int);
76  vtkGetMacro(Modifier, int);
78 
80 
83  vtkSetMacro(KeyCode, char);
84  vtkGetMacro(KeyCode, char);
86 
88 
91  vtkSetMacro(RepeatCount, int);
92  vtkGetMacro(RepeatCount, int);
94 
96 
99  vtkSetStringMacro(KeySym);
100  vtkGetStringMacro(KeySym);
102 
106  static int GetModifier(vtkRenderWindowInteractor*);
107 
112  bool operator==(vtkEvent*);
113  bool operator==(unsigned long VTKEvent); // event with no modifiers
114 
115 protected:
116  vtkEvent();
117  ~vtkEvent() override;
118 
119  unsigned long EventId;
120  int Modifier;
121  char KeyCode;
123  char* KeySym;
124 
125 private:
126  vtkEvent(const vtkEvent&) = delete;
127  void operator=(const vtkEvent&) = delete;
128 };
129 
130 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
int RepeatCount
Definition: vtkEvent.h:122
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:54
char KeyCode
Definition: vtkEvent.h:121
platform-independent render window interaction including picking and frame rate control.
bool VTKCOMMONDATAMODEL_EXPORT operator==(vtkEdgeBase e1, vtkEdgeBase e2)
a simple class to control print indentation
Definition: vtkIndent.h:39
char * KeySym
Definition: vtkEvent.h:123
int Modifier
Definition: vtkEvent.h:120
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:34
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:119