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:
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);
91  int RemoveTranslation(unsigned long VTKEvent);
92  int RemoveTranslation(const char *VTKEvent);
94 
97  void ClearEvents();
98 
99 //BTX
101 
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 
vtkWidgetEventTranslator::SetTranslation
void SetTranslation(unsigned long VTKEvent, int modifier, char keyCode, int repeatCount, const char *keySym, unsigned long widgetEvent)
vtkWidgetEventTranslator::GetTranslation
unsigned long GetTranslation(vtkEvent *VTKEvent)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkInteractionWidgetsModule.h
vtkWidgetEventTranslator::RemoveTranslation
int RemoveTranslation(const char *VTKEvent)
vtkEvent
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:34
vtkWidgetEventTranslator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:66
vtkWidgetEventTranslator::Event
vtkEvent * Event
Definition: vtkWidgetEventTranslator.h:117
vtkWidgetEventTranslator::vtkWidgetEventTranslator
vtkWidgetEventTranslator()
vtkWidgetEventTranslator::ClearEvents
void ClearEvents()
vtkWidgetEventTranslator::GetTranslation
const char * GetTranslation(const char *VTKEvent)
vtkWidgetEventTranslator::~vtkWidgetEventTranslator
~vtkWidgetEventTranslator()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkWidgetEventTranslator::SetTranslation
void SetTranslation(unsigned long VTKEvent, unsigned long widgetEvent)
vtkWidgetEventTranslator::EventMap
vtkEventMap * EventMap
Definition: vtkWidgetEventTranslator.h:114
vtkWidgetEventTranslator::GetTranslation
unsigned long GetTranslation(unsigned long VTKEvent)
vtkWidgetEventTranslator::RemoveTranslation
int RemoveTranslation(unsigned long VTKEvent)
vtkWidgetEventTranslator::AddEventsToInteractor
void AddEventsToInteractor(vtkRenderWindowInteractor *, vtkCallbackCommand *, float priority)
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkObject.h
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkWidgetEventTranslator::SetTranslation
void SetTranslation(vtkEvent *VTKevent, unsigned long widgetEvent)
vtkWidgetEventTranslator::RemoveTranslation
int RemoveTranslation(unsigned long VTKEvent, int modifier, char keyCode, int repeatCount, char *keySym)
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkWidgetEventTranslator::RemoveTranslation
int RemoveTranslation(vtkEvent *e)
vtkWidgetEventTranslator
map VTK events into widget events
Definition: vtkWidgetEventTranslator.h:51
vtkWidgetEventTranslator::New
static vtkWidgetEventTranslator * New()
vtkWidgetEventTranslator::GetTranslation
unsigned long GetTranslation(unsigned long VTKEvent, int modifier, char keyCode, int repeatCount, char *keySym)
vtkWidgetEventTranslator::AddEventsToParent
void AddEventsToParent(vtkAbstractWidget *, vtkCallbackCommand *, float priority)
vtkX3D::priority
@ priority
Definition: vtkX3D.h:450
vtkWidgetEventTranslator::SetTranslation
void SetTranslation(const char *VTKEvent, const char *widgetEvent)