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=========================================================================*/
29#ifndef vtkWidgetCallbackMapper_h
30#define vtkWidgetCallbackMapper_h
31
32#include "vtkInteractionWidgetsModule.h" // For export macro
33#include "vtkObject.h"
34
35class vtkWidgetEvent;
38class vtkCallbackMap; // PIMPL encapsulation of STL map
39
40
41class VTKINTERACTIONWIDGETS_EXPORT vtkWidgetCallbackMapper : public vtkObject
42{
43public:
48
50
54 void PrintSelf(ostream& os, vtkIndent indent);
56
58
62 vtkGetObjectMacro(EventTranslator,vtkWidgetEventTranslator);
64
68 typedef void (*CallbackType)(vtkAbstractWidget*);
69
71
81 void SetCallbackMethod(unsigned long VTKEvent, unsigned long widgetEvent,
82 vtkAbstractWidget *w, CallbackType f);
83 void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode,
84 int repeatCount, const char* keySym,
85 unsigned long widgetEvent,
86 vtkAbstractWidget *w, CallbackType f);
87 //void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
88 // vtkAbstractWidget *w, CallbackType f);
90
95 void InvokeCallback(unsigned long widgetEvent);
96
97protected:
100
101 // Translates VTK events into widget events
103
104 // Invoke the method associated with a particular widget event
105 vtkCallbackMap *CallbackMap;
106
112 void SetCallbackMethod(unsigned long widgetEvent,
113 vtkAbstractWidget *w, CallbackType f);
114
115
116private:
117 vtkWidgetCallbackMapper(const vtkWidgetCallbackMapper&) VTK_DELETE_FUNCTION;
118 void operator=(const vtkWidgetCallbackMapper&) VTK_DELETE_FUNCTION;
119
120};
121
122
123#endif /* vtkWidgetCallbackMapper_h */
124
define the API for widget / widget representation
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
map widget events into callbacks
void SetCallbackMethod(unsigned long widgetEvent, vtkAbstractWidget *w, CallbackType f)
This method is used to assign a callback (implemented as a static class method) to a particular widge...
void SetEventTranslator(vtkWidgetEventTranslator *t)
Specify the vtkWidgetEventTranslator to coordinate with.
void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode, int repeatCount, const char *keySym, unsigned long widgetEvent, vtkAbstractWidget *w, CallbackType f)
vtkWidgetEventTranslator * EventTranslator
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkWidgetCallbackMapper * New()
Instantiate the class.
void SetCallbackMethod(unsigned long VTKEvent, unsigned long widgetEvent, vtkAbstractWidget *w, CallbackType f)
This class works with the class vtkWidgetEventTranslator to set up the initial coorespondence between...
void InvokeCallback(unsigned long widgetEvent)
This method invokes the callback given a widget event.
map VTK events into widget events
define widget events