VTK
dox/Interaction/Widgets/vtkEvent.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkEvent.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 =========================================================================*/
00025 #ifndef __vtkEvent_h
00026 #define __vtkEvent_h
00027 
00028 #include "vtkInteractionWidgetsModule.h" // For export macro
00029 #include "vtkObject.h"
00030 
00031 class vtkRenderWindowInteractor;
00032 
00033 class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
00034 {
00035 public:
00037   static vtkEvent *New();
00038 
00040 
00041   vtkTypeMacro(vtkEvent,vtkObject);
00042   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00045 //BTX
00047 
00049   enum EventModifiers {
00050     AnyModifier = -1,
00051     NoModifier = 0,
00052     ShiftModifier = 1,
00053     ControlModifier = 2,
00054     AltModifier = 4
00055   };
00056 //ETX
00058 
00060 
00061   vtkSetMacro(EventId,unsigned long);
00062   vtkGetMacro(EventId,unsigned long);
00064 
00066 
00067   vtkSetMacro(Modifier,int);
00068   vtkGetMacro(Modifier,int);
00070 
00072 
00073   vtkSetMacro(KeyCode,char);
00074   vtkGetMacro(KeyCode,char);
00076 
00078 
00079   vtkSetMacro(RepeatCount,int);
00080   vtkGetMacro(RepeatCount,int);
00082 
00084 
00085   vtkSetStringMacro(KeySym);
00086   vtkGetStringMacro(KeySym);
00088 
00090   static int GetModifier(vtkRenderWindowInteractor*);
00091 
00092 //BTX
00094 
00096   int operator==(vtkEvent*);
00097   int operator==(unsigned long VTKEvent);  //event with no modifiers
00098 //ETX
00100 
00101 protected:
00102   vtkEvent();
00103   virtual ~vtkEvent();
00104 
00105   unsigned long EventId;
00106   int           Modifier;
00107   char          KeyCode;
00108   int           RepeatCount;
00109   char*         KeySym;
00110 
00111 private:
00112   vtkEvent(const vtkEvent&);  //Not implemented
00113   void operator=(const vtkEvent&);  //Not implemented
00114 
00115 };
00116 
00117 #endif