VTK  9.3.0
vtkWidgetCallbackMapper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
17#ifndef vtkWidgetCallbackMapper_h
18#define vtkWidgetCallbackMapper_h
19
20#include "vtkInteractionWidgetsModule.h" // For export macro
21#include "vtkObject.h"
22
23VTK_ABI_NAMESPACE_BEGIN
24class vtkWidgetEvent;
27class vtkCallbackMap; // PIMPL encapsulation of STL map
28class vtkEventData;
29
30class VTKINTERACTIONWIDGETS_EXPORT vtkWidgetCallbackMapper : public vtkObject
31{
32public:
37
39
43 void PrintSelf(ostream& os, vtkIndent indent) override;
45
47
51 vtkGetObjectMacro(EventTranslator, vtkWidgetEventTranslator);
53
57 typedef void (*CallbackType)(vtkAbstractWidget*);
58
60
71 unsigned long VTKEvent, unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
72 void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode, int repeatCount,
73 const char* keySym, unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
74 void SetCallbackMethod(unsigned long VTKEvent, vtkEventData* ed, unsigned long widgetEvent,
75 vtkAbstractWidget* w, CallbackType f);
76 // void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
77 // vtkAbstractWidget *w, CallbackType f);
79
84 void InvokeCallback(unsigned long widgetEvent);
85
86protected:
89
90 // Translates VTK events into widget events
92
93 // Invoke the method associated with a particular widget event
94 vtkCallbackMap* CallbackMap;
95
101 void SetCallbackMethod(unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
102
103private:
105 void operator=(const vtkWidgetCallbackMapper&) = delete;
106};
107
108VTK_ABI_NAMESPACE_END
109#endif /* vtkWidgetCallbackMapper_h */
define the API for widget / widget representation
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
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 PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
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)
This class works with the class vtkWidgetEventTranslator to set up the initial coorespondence between...
void SetCallbackMethod(unsigned long VTKEvent, vtkEventData *ed, unsigned long widgetEvent, vtkAbstractWidget *w, CallbackType f)
This class works with the class vtkWidgetEventTranslator to set up the initial coorespondence between...
vtkWidgetEventTranslator * EventTranslator
~vtkWidgetCallbackMapper() override
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