VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkContextMouseEvent.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00030 #ifndef __vtkContextMouseEvent_h 00031 #define __vtkContextMouseEvent_h 00032 00033 #include "vtkRenderingContext2DModule.h" // For export macro 00034 #include "vtkWin32Header.h" // For export macros. 00035 #include "vtkVector.h" // Needed for vtkVector2f and vtkVector2i 00036 00037 class vtkRenderWindowInteractor; 00038 00039 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextMouseEvent 00040 { 00041 public: 00043 00044 enum { 00045 NO_BUTTON = 0, 00046 LEFT_BUTTON = 1, 00047 MIDDLE_BUTTON = 2, 00048 RIGHT_BUTTON = 4 00049 }; 00051 00053 00054 enum { 00055 NO_MODIFIER = 0, 00056 ALT_MODIFIER = 1, 00057 SHIFT_MODIFIER = 2, 00058 CONTROL_MODIFIER = 4 00059 }; 00061 00062 vtkContextMouseEvent() 00063 { 00064 } 00065 00067 00068 void SetInteractor(vtkRenderWindowInteractor *interactor) 00069 { 00070 this->Interactor = interactor; 00071 } 00073 00075 00077 vtkRenderWindowInteractor* GetInteractor() const 00078 { 00079 return this->Interactor; 00080 } 00082 00084 00085 void SetPos(const vtkVector2f &pos) { this->Pos = pos; } 00086 vtkVector2f GetPos() const { return this->Pos; } 00088 00090 00091 void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; } 00092 vtkVector2f GetScenePos() const { return this->ScenePos; } 00094 00096 00097 void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; } 00098 vtkVector2i GetScreenPos() const { return this->ScreenPos; } 00100 00102 00103 void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; } 00104 vtkVector2f GetLastPos() const { return this->LastPos; } 00106 00108 00109 void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; } 00110 vtkVector2f GetLastScenePos() const { return this->LastScenePos; } 00112 00114 00115 void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; } 00116 vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; } 00118 00120 00122 void SetButton(int button) { this->Button = button; } 00123 int GetButton() const { return this->Button; } 00125 00129 int GetModifiers() const; 00130 00131 #ifdef VTK_LEGACY_REMOVE 00132 // Deprecating the public exposure of member variables for mouse events 00133 // Deprecated in VTK 5.9. 00134 protected: 00135 #endif 00136 00137 vtkVector2f Pos; 00138 00140 vtkVector2f ScenePos; 00141 00143 vtkVector2i ScreenPos; 00144 00146 vtkVector2f LastPos; 00147 00149 vtkVector2f LastScenePos; 00150 00152 vtkVector2i LastScreenPos; 00153 00155 int Button; 00156 00157 protected: 00158 vtkRenderWindowInteractor *Interactor; 00159 }; 00160 00161 #endif // __vtkContextMouseEvent_h 00162 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h