VTK
dox/Rendering/Context2D/vtkContextMouseEvent.h
Go to the documentation of this file.
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 
00066   ~vtkContextMouseEvent()
00067   {
00068   }
00069 
00071 
00072   void SetInteractor(vtkRenderWindowInteractor *interactor)
00073   {
00074     this->Interactor = interactor;
00075   }
00077 
00079 
00081   vtkRenderWindowInteractor* GetInteractor() const
00082   {
00083     return this->Interactor;
00084   }
00086 
00088 
00089   void SetPos(const vtkVector2f &pos) { this->Pos = pos; }
00090   vtkVector2f GetPos() const { return this->Pos; }
00092 
00094 
00095   void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; }
00096   vtkVector2f GetScenePos() const { return this->ScenePos; }
00098 
00100 
00101   void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; }
00102   vtkVector2i GetScreenPos() const { return this->ScreenPos; }
00104 
00106 
00107   void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; }
00108   vtkVector2f GetLastPos() const { return this->LastPos; }
00110 
00112 
00113   void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; }
00114   vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
00116 
00118 
00119   void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; }
00120   vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
00122 
00124 
00126   void SetButton(int button) { this->Button = button; }
00127   int GetButton() const { return this->Button; }
00129 
00133   int GetModifiers() const;
00134 
00135 #ifdef VTK_LEGACY_REMOVE
00136   // Deprecating the public exposure of member variables for mouse events
00137   // Deprecated in VTK 5.9.
00138 protected:
00139 #endif
00140 
00141   vtkVector2f Pos;
00142 
00144   vtkVector2f ScenePos;
00145 
00147   vtkVector2i ScreenPos;
00148 
00150   vtkVector2f LastPos;
00151 
00153   vtkVector2f LastScenePos;
00154 
00156   vtkVector2i LastScreenPos;
00157 
00159   int Button;
00160 
00161 protected:
00162   vtkRenderWindowInteractor *Interactor;
00163 };
00164 
00165 #endif // __vtkContextMouseEvent_h
00166 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h