• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/Widgets/vtkWidgetEventTranslator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkWidgetEventTranslator.h,v $
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 =========================================================================*/
00035 #ifndef __vtkWidgetEventTranslator_h
00036 #define __vtkWidgetEventTranslator_h
00037 
00038 #include "vtkObject.h"
00039 
00040 // Support PIMPL encapsulation of internal STL map
00041 class vtkEventMap;
00042 class vtkRenderWindowInteractor;
00043 class vtkCallbackCommand;
00044 class vtkEvent;
00045 class vtkAbstractWidget;
00046 
00047 
00048 // This is a lightweight class that should be used internally by the widgets
00049 class VTK_WIDGETS_EXPORT vtkWidgetEventTranslator : public vtkObject
00050 {
00051 public:
00053   static vtkWidgetEventTranslator *New();
00054 
00056 
00057   vtkTypeRevisionMacro(vtkWidgetEventTranslator,vtkObject);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00060 
00062 
00065   void SetTranslation(unsigned long VTKEvent, unsigned long widgetEvent);
00066   void SetTranslation(const char *VTKEvent, const char *widgetEvent);
00067   void SetTranslation(unsigned long VTKEvent, int modifier, char keyCode,
00068                       int repeatCount, const char* keySym, unsigned long widgetEvent);
00069   void SetTranslation(vtkEvent *VTKevent, unsigned long widgetEvent);
00071   
00073 
00076   unsigned long GetTranslation(unsigned long VTKEvent);
00077   const char *GetTranslation(const char *VTKEvent);
00078   unsigned long GetTranslation(unsigned long VTKEvent, int modifier, char keyCode,
00079                                int repeatCount, char* keySym);
00080   unsigned long GetTranslation(vtkEvent *VTKEvent);
00082 
00084 
00086   int RemoveTranslation( unsigned long VTKEvent,
00087                          int modifier,    char keyCode,
00088                          int repeatCount, char* keySym);
00089   int RemoveTranslation( vtkEvent *e );
00090   int RemoveTranslation(unsigned long VTKEvent);
00092   
00095   void ClearEvents();
00096   
00097 //BTX
00099 
00100   void AddEventsToParent(vtkAbstractWidget*, vtkCallbackCommand*, float priority);
00101   void AddEventsToInteractor(vtkRenderWindowInteractor*, vtkCallbackCommand*, 
00102                              float priority);
00104 //ETX
00105   
00106 protected:
00107   // Constructors/destructors made public for widgets to use
00108   vtkWidgetEventTranslator();
00109   ~vtkWidgetEventTranslator();
00110 
00111   // Map VTK events to widget events
00112   vtkEventMap *EventMap;
00113   
00114   // Used for performance reasons to avoid object construction/deletion
00115   vtkEvent *Event;
00116   
00117 private:
00118   vtkWidgetEventTranslator(const vtkWidgetEventTranslator&);  //Not implemented
00119   void operator=(const vtkWidgetEventTranslator&);  //Not implemented
00120 
00121 };
00122 
00123 #endif /* __vtkWidgetEventTranslator_h */
00124  

Generated by  doxygen 1.7.1