VTK  9.1.0
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
31class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
32{
33public:
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
104
110 bool operator==(unsigned long VTKEvent); // event with no modifiers
111
112protected:
114 ~vtkEvent() override;
115
116 unsigned long EventId;
120 char* KeySym;
121
122private:
123 vtkEvent(const vtkEvent&) = delete;
124 void operator=(const vtkEvent&) = delete;
125};
126
127#endif
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:32
char * KeySym
Definition: vtkEvent.h:120
unsigned long EventId
Definition: vtkEvent.h:116
bool operator==(vtkEvent *)
Used to compare whether two events are equal.
EventModifiers
Ways to specify modifiers to VTK events.
Definition: vtkEvent.h:52
static vtkEvent * New()
The object factory constructor.
int RepeatCount
Definition: vtkEvent.h:119
int Modifier
Definition: vtkEvent.h:117
~vtkEvent() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static int GetModifier(vtkRenderWindowInteractor *)
Convenience method computes the event modifier from an interactor.
bool operator==(unsigned long VTKEvent)
char KeyCode
Definition: vtkEvent.h:118
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
platform-independent render window interaction including picking and frame rate control.