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 "vtkObject.h"
32 
33 class vtkWidgetEvent;
34 class vtkAbstractWidget;
36 class vtkCallbackMap; // PIMPL encapsulation of STL map
37 
38 
40 {
41 public:
43  static vtkWidgetCallbackMapper *New();
44 
46 
48  void PrintSelf(ostream& os, vtkIndent indent);
50 
52 
53  void SetEventTranslator(vtkWidgetEventTranslator *t);
54  vtkGetObjectMacro(EventTranslator,vtkWidgetEventTranslator);
56 
57 //BTX
59 
60  typedef void (*CallbackType)(vtkAbstractWidget*);
61 //ETX
63 
65 
73  void SetCallbackMethod(unsigned long VTKEvent, unsigned long widgetEvent,
74  vtkAbstractWidget *w, CallbackType f);
75  void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode,
76  int repeatCount, const char* keySym,
77  unsigned long widgetEvent,
78  vtkAbstractWidget *w, CallbackType f);
79  //void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
80  // vtkAbstractWidget *w, CallbackType f);
82 
85  void InvokeCallback(unsigned long widgetEvent);
86 
87 protected:
90 
91  // Translates VTK events into widget events
93 
94  // Invoke the method associated with a particular widget event
95  vtkCallbackMap *CallbackMap;
96 
98 
102  void SetCallbackMethod(unsigned long widgetEvent,
103  vtkAbstractWidget *w, CallbackType f);
105 
106 
107 private:
108  vtkWidgetCallbackMapper(const vtkWidgetCallbackMapper&); //Not implemented
109  void operator=(const vtkWidgetCallbackMapper&); //Not implemented
110 
111 };
112 
113 
114 #endif /* __vtkWidgetCallbackMapper_h */
115 
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkWidgetEventTranslator * EventTranslator
map VTK events into widget events
define widget events
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_WIDGETS_EXPORT
define the API for widget / widget representation
map widget events into callbacks
static vtkObject * New()