VTK
vtkWidgetCallbackMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWidgetCallbackMapper.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 =========================================================================*/
28 #ifndef vtkWidgetCallbackMapper_h
29 #define vtkWidgetCallbackMapper_h
30 
31 #include "vtkInteractionWidgetsModule.h" // For export macro
32 #include "vtkObject.h"
33 
34 class vtkWidgetEvent;
35 class vtkAbstractWidget;
37 class vtkCallbackMap; // PIMPL encapsulation of STL map
38 
39 
41 {
42 public:
44  static vtkWidgetCallbackMapper *New();
45 
47 
49  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
54  void SetEventTranslator(vtkWidgetEventTranslator *t);
55  vtkGetObjectMacro(EventTranslator,vtkWidgetEventTranslator);
57 
58 //BTX
60 
61  typedef void (*CallbackType)(vtkAbstractWidget*);
62 //ETX
64 
66 
74  void SetCallbackMethod(unsigned long VTKEvent, unsigned long widgetEvent,
75  vtkAbstractWidget *w, CallbackType f);
76  void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode,
77  int repeatCount, const char* keySym,
78  unsigned long widgetEvent,
79  vtkAbstractWidget *w, CallbackType f);
80  //void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
81  // vtkAbstractWidget *w, CallbackType f);
83 
86  void InvokeCallback(unsigned long widgetEvent);
87 
88 protected:
91 
92  // Translates VTK events into widget events
94 
95  // Invoke the method associated with a particular widget event
96  vtkCallbackMap *CallbackMap;
97 
99 
103  void SetCallbackMethod(unsigned long widgetEvent,
104  vtkAbstractWidget *w, CallbackType f);
106 
107 
108 private:
109  vtkWidgetCallbackMapper(const vtkWidgetCallbackMapper&); //Not implemented
110  void operator=(const vtkWidgetCallbackMapper&); //Not implemented
111 
112 };
113 
114 
115 #endif /* vtkWidgetCallbackMapper_h */
116 
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkWidgetEventTranslator * EventTranslator
map VTK events into widget events
define widget events
#define VTKINTERACTIONWIDGETS_EXPORT
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
map widget events into callbacks
static vtkObject * New()