VTK
dox/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 "vtkObject.h"
00029 
00030 class vtkRenderWindowInteractor;
00031 
00032 class VTK_WIDGETS_EXPORT vtkEvent : public vtkObject
00033 {
00034 public:
00036   static vtkEvent *New();
00037 
00039 
00040   vtkTypeMacro(vtkEvent,vtkObject);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00043 
00044 //BTX
00046 
00048   enum EventModifiers {
00049     AnyModifier = -1,
00050     NoModifier = 0,
00051     ShiftModifier = 1,
00052     ControlModifier = 2,
00053     AltModifier = 4
00054   };
00055 //ETX
00057 
00059 
00060   vtkSetMacro(EventId,unsigned long);
00061   vtkGetMacro(EventId,unsigned long);
00063   
00065 
00066   vtkSetMacro(Modifier,int);
00067   vtkGetMacro(Modifier,int);
00069   
00071 
00072   vtkSetMacro(KeyCode,char);
00073   vtkGetMacro(KeyCode,char);
00075   
00077 
00078   vtkSetMacro(RepeatCount,int);
00079   vtkGetMacro(RepeatCount,int);
00081   
00083 
00084   vtkSetStringMacro(KeySym);
00085   vtkGetStringMacro(KeySym);
00087 
00089   static int GetModifier(vtkRenderWindowInteractor*);
00090 
00091 //BTX
00093 
00095   int operator==(vtkEvent*);  
00096   int operator==(unsigned long VTKEvent);  //event with no modifiers
00097 //ETX
00099 
00100 protected:
00101   vtkEvent();
00102   virtual ~vtkEvent();
00103   
00104   unsigned long EventId;
00105   int           Modifier;
00106   char          KeyCode;
00107   int           RepeatCount;
00108   char*         KeySym;
00109   
00110 private:
00111   vtkEvent(const vtkEvent&);  //Not implemented
00112   void operator=(const vtkEvent&);  //Not implemented
00113 
00114 };
00115 
00116 #endif