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 
39 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextMouseEvent
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  {
68  }
69 
71 
72  void SetInteractor(vtkRenderWindowInteractor *interactor)
73  {
74  this->Interactor = interactor;
75  }
77 
79 
81  vtkRenderWindowInteractor* GetInteractor() const
82  {
83  return this->Interactor;
84  }
86 
88 
89  void SetPos(const vtkVector2f &pos) { this->Pos = pos; }
90  vtkVector2f GetPos() const { return this->Pos; }
92 
94 
95  void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; }
96  vtkVector2f GetScenePos() const { return this->ScenePos; }
98 
100 
101  void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; }
102  vtkVector2i GetScreenPos() const { return this->ScreenPos; }
104 
106 
107  void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; }
108  vtkVector2f GetLastPos() const { return this->LastPos; }
110 
112 
113  void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; }
114  vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
116 
118 
119  void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; }
120  vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
122 
124 
126  void SetButton(int button) { this->Button = button; }
127  int GetButton() const { return this->Button; }
129 
133  int GetModifiers() const;
134 
135 #ifdef VTK_LEGACY_REMOVE
136  // Deprecating the public exposure of member variables for mouse events
137  // Deprecated in VTK 5.9.
138 protected:
139 #endif
140 
142 
145 
148 
151 
154 
157 
159  int Button;
160 
161 protected:
163 };
164 
165 #endif // __vtkContextMouseEvent_h
166 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h