VTK  9.1.0
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=========================================================================*/
58#ifndef vtkWidgetCallbackMapper_h
59#define vtkWidgetCallbackMapper_h
60
61#include "vtkInteractionWidgetsModule.h" // For export macro
62#include "vtkObject.h"
63
64class vtkWidgetEvent;
67class vtkCallbackMap; // PIMPL encapsulation of STL map
68class vtkEventData;
69
70class VTKINTERACTIONWIDGETS_EXPORT vtkWidgetCallbackMapper : public vtkObject
71{
72public:
77
79
83 void PrintSelf(ostream& os, vtkIndent indent) override;
85
87
91 vtkGetObjectMacro(EventTranslator, vtkWidgetEventTranslator);
93
97 typedef void (*CallbackType)(vtkAbstractWidget*);
98
100
111 unsigned long VTKEvent, unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
112 void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode, int repeatCount,
113 const char* keySym, unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
114 void SetCallbackMethod(unsigned long VTKEvent, vtkEventData* ed, unsigned long widgetEvent,
115 vtkAbstractWidget* w, CallbackType f);
116 // void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
117 // vtkAbstractWidget *w, CallbackType f);
119
124 void InvokeCallback(unsigned long widgetEvent);
125
126protected:
129
130 // Translates VTK events into widget events
132
133 // Invoke the method associated with a particular widget event
134 vtkCallbackMap* CallbackMap;
135
141 void SetCallbackMethod(unsigned long widgetEvent, vtkAbstractWidget* w, CallbackType f);
142
143private:
145 void operator=(const vtkWidgetCallbackMapper&) = delete;
146};
147
148#endif /* vtkWidgetCallbackMapper_h */
define the API for widget / widget representation
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
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