VTK
vtkWidgetEventTranslator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWidgetEventTranslator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef vtkWidgetEventTranslator_h
36 #define vtkWidgetEventTranslator_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkObject.h"
40 
41 // Support PIMPL encapsulation of internal STL map
42 class vtkEventMap;
44 class vtkCallbackCommand;
45 class vtkEvent;
46 class vtkAbstractWidget;
47 
48 
49 // This is a lightweight class that should be used internally by the widgets
51 {
52 public:
54  static vtkWidgetEventTranslator *New();
55 
57 
59  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
66  void SetTranslation(unsigned long VTKEvent, unsigned long widgetEvent);
67  void SetTranslation(const char *VTKEvent, const char *widgetEvent);
68  void SetTranslation(unsigned long VTKEvent, int modifier, char keyCode,
69  int repeatCount, const char* keySym, unsigned long widgetEvent);
70  void SetTranslation(vtkEvent *VTKevent, unsigned long widgetEvent);
72 
74 
77  unsigned long GetTranslation(unsigned long VTKEvent);
78  const char *GetTranslation(const char *VTKEvent);
79  unsigned long GetTranslation(unsigned long VTKEvent, int modifier, char keyCode,
80  int repeatCount, char* keySym);
81  unsigned long GetTranslation(vtkEvent *VTKEvent);
83 
85 
87  int RemoveTranslation( unsigned long VTKEvent,
88  int modifier, char keyCode,
89  int repeatCount, char* keySym);
90  int RemoveTranslation( vtkEvent *e );
91  int RemoveTranslation(unsigned long VTKEvent);
92  int RemoveTranslation(const char *VTKEvent);
94 
97  void ClearEvents();
98 
99 //BTX
101 
102  void AddEventsToParent(vtkAbstractWidget*, vtkCallbackCommand*, float priority);
103  void AddEventsToInteractor(vtkRenderWindowInteractor*, vtkCallbackCommand*,
104  float priority);
105 //ETX
107 
108 protected:
109  // Constructors/destructors made public for widgets to use
112 
113  // Map VTK events to widget events
114  vtkEventMap *EventMap;
115 
116  // Used for performance reasons to avoid object construction/deletion
118 
119 private:
120  vtkWidgetEventTranslator(const vtkWidgetEventTranslator&); //Not implemented
121  void operator=(const vtkWidgetEventTranslator&); //Not implemented
122 
123 };
124 
125 #endif /* vtkWidgetEventTranslator_h */
126 
abstract base class for most VTK objects
Definition: vtkObject.h:61
map VTK events into widget events
platform-independent render window interaction including picking and frame rate control.
#define VTKINTERACTIONWIDGETS_EXPORT
supports function callbacks
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
define the API for widget / widget representation
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:33
static vtkObject * New()