VTK
vtkContextMouseEvent.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContextMouseEvent.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 =========================================================================*/
15 
30 #ifndef vtkContextMouseEvent_h
31 #define vtkContextMouseEvent_h
32 
33 #include "vtkRenderingContext2DModule.h" // For export macro
34 #include "vtkWin32Header.h" // For export macros.
35 #include "vtkVector.h" // Needed for vtkVector2f and vtkVector2i
36 
38 
40 {
41 public:
43 
44  enum {
45  NO_BUTTON = 0,
46  LEFT_BUTTON = 1,
47  MIDDLE_BUTTON = 2,
48  RIGHT_BUTTON = 4
49  };
51 
53 
54  enum {
55  NO_MODIFIER = 0,
56  ALT_MODIFIER = 1,
57  SHIFT_MODIFIER = 2,
58  CONTROL_MODIFIER = 4
59  };
61 
63  {
64  }
65 
67 
69  {
70  this->Interactor = interactor;
71  }
73 
75 
78  {
79  return this->Interactor;
80  }
82 
84 
85  void SetPos(const vtkVector2f &pos) { this->Pos = pos; }
86  vtkVector2f GetPos() const { return this->Pos; }
88 
90 
91  void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; }
92  vtkVector2f GetScenePos() const { return this->ScenePos; }
94 
96 
97  void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; }
98  vtkVector2i GetScreenPos() const { return this->ScreenPos; }
100 
102 
103  void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; }
104  vtkVector2f GetLastPos() const { return this->LastPos; }
106 
108 
109  void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; }
110  vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
112 
114 
115  void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; }
116  vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
118 
120 
122  void SetButton(int button) { this->Button = button; }
123  int GetButton() const { return this->Button; }
125 
129  int GetModifiers() const;
130 
131 protected:
134 
137 
140 
143 
146 
149 
151  int Button;
152 
153 protected:
155 };
156 
157 #endif // vtkContextMouseEvent_h
158 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:40
vtkContextMouseEvent::ScreenPos
vtkVector2i ScreenPos
Definition: vtkContextMouseEvent.h:139
vtkContextMouseEvent::Pos
vtkVector2f Pos
Definition: vtkContextMouseEvent.h:133
vtkContextMouseEvent::SetLastScenePos
void SetLastScenePos(const vtkVector2f &pos)
Definition: vtkContextMouseEvent.h:109
VTKRENDERINGCONTEXT2D_EXPORT
#define VTKRENDERINGCONTEXT2D_EXPORT
Definition: vtkRenderingContext2DModule.h:15
vtkVector.h
vtkContextMouseEvent::SetLastScreenPos
void SetLastScreenPos(const vtkVector2i &pos)
Definition: vtkContextMouseEvent.h:115
vtkContextMouseEvent::GetButton
int GetButton() const
Definition: vtkContextMouseEvent.h:123
vtkContextMouseEvent::SetScreenPos
void SetScreenPos(const vtkVector2i &pos)
Definition: vtkContextMouseEvent.h:97
vtkContextMouseEvent::LastScreenPos
vtkVector2i LastScreenPos
Definition: vtkContextMouseEvent.h:148
vtkContextMouseEvent::GetScreenPos
vtkVector2i GetScreenPos() const
Definition: vtkContextMouseEvent.h:98
vtkContextMouseEvent::LastScenePos
vtkVector2f LastScenePos
Definition: vtkContextMouseEvent.h:145
vtkContextMouseEvent::SetLastPos
void SetLastPos(const vtkVector2f &pos)
Definition: vtkContextMouseEvent.h:103
vtkContextMouseEvent::SetPos
void SetPos(const vtkVector2f &pos)
Definition: vtkContextMouseEvent.h:85
vtkContextMouseEvent::GetScenePos
vtkVector2f GetScenePos() const
Definition: vtkContextMouseEvent.h:92
vtkContextMouseEvent::SetInteractor
void SetInteractor(vtkRenderWindowInteractor *interactor)
Definition: vtkContextMouseEvent.h:68
vtkContextMouseEvent::GetPos
vtkVector2f GetPos() const
Definition: vtkContextMouseEvent.h:86
vtkContextMouseEvent::SetButton
void SetButton(int button)
Definition: vtkContextMouseEvent.h:122
vtkContextMouseEvent::GetLastPos
vtkVector2f GetLastPos() const
Definition: vtkContextMouseEvent.h:104
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkContextMouseEvent::ScenePos
vtkVector2f ScenePos
Definition: vtkContextMouseEvent.h:136
vtkContextMouseEvent::GetModifiers
int GetModifiers() const
vtkContextMouseEvent::GetLastScenePos
vtkVector2f GetLastScenePos() const
Definition: vtkContextMouseEvent.h:110
vtkContextMouseEvent::vtkContextMouseEvent
vtkContextMouseEvent()
Definition: vtkContextMouseEvent.h:62
vtkWin32Header.h
vtkContextMouseEvent::GetInteractor
vtkRenderWindowInteractor * GetInteractor() const
Definition: vtkContextMouseEvent.h:77
vtkContextMouseEvent::GetLastScreenPos
vtkVector2i GetLastScreenPos() const
Definition: vtkContextMouseEvent.h:116
vtkContextMouseEvent::Button
int Button
Definition: vtkContextMouseEvent.h:151
vtkVector2i
Definition: vtkVector.h:266
vtkRenderingContext2DModule.h
vtkContextMouseEvent::LastPos
vtkVector2f LastPos
Definition: vtkContextMouseEvent.h:142
vtkVector2f
Definition: vtkVector.h:277
vtkContextMouseEvent::SetScenePos
void SetScenePos(const vtkVector2f &pos)
Definition: vtkContextMouseEvent.h:91
vtkContextMouseEvent::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkContextMouseEvent.h:154