VTK  9.4.20250130
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
46#ifndef vtkWidgetCallbackMapper_h
47#define vtkWidgetCallbackMapper_h
48
49#include "vtkInteractionWidgetsModule.h" // For export macro
50#include "vtkObject.h"
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkWidgetEvent;
56class vtkCallbackMap; // PIMPL encapsulation of STL map
57class vtkEventData;
58
59class VTKINTERACTIONWIDGETS_EXPORT vtkWidgetCallbackMapper : public vtkObject
60{
61public:
66
68
72 void PrintSelf(ostream& os, vtkIndent indent) override;
74
76
80 vtkGetObjectMacro(EventTranslator, vtkWidgetEventTranslator);
82
86 typedef void (*CallbackType)(vtkAbstractWidget*);
87
89
100 unsigned long VTKEvent, unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
101 void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode, int repeatCount,
102 const char* keySym, unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
103 void SetCallbackMethod(unsigned long VTKEvent, vtkEventData* ed, unsigned long widgetEvent,
104 vtkAbstractWidget* w, CallbackType f);
105 // void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
106 // vtkAbstractWidget *w, CallbackType f);
108
113 void InvokeCallback(unsigned long widgetEvent);
114
115protected:
118
119 // Translates VTK events into widget events
121
122 // Invoke the method associated with a particular widget event
123 vtkCallbackMap* CallbackMap;
124
130 void SetCallbackMethod(unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
131
132private:
134 void operator=(const vtkWidgetCallbackMapper&) = delete;
135};
136
137VTK_ABI_NAMESPACE_END
138#endif /* vtkWidgetCallbackMapper_h */
define the API for widget / widget representation
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
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