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 
35 class vtkWidgetEvent;
36 class vtkAbstractWidget;
38 class vtkCallbackMap; // PIMPL encapsulation of STL map
39 class vtkEventData;
40 
41 class VTKINTERACTIONWIDGETS_EXPORT vtkWidgetCallbackMapper : public vtkObject
42 {
43 public:
48 
50 
54  void PrintSelf(ostream& os, vtkIndent indent) override;
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(unsigned long VTKEvent, vtkEventData *ed,
88  unsigned long widgetEvent,
89  vtkAbstractWidget *w, CallbackType f);
90  //void SetCallbackMethod(vtkWidgetEvent *vtkEvent, unsigned long widgetEvent,
91  // vtkAbstractWidget *w, CallbackType f);
93 
98  void InvokeCallback(unsigned long widgetEvent);
99 
100 protected:
103 
104  // Translates VTK events into widget events
106 
107  // Invoke the method associated with a particular widget event
108  vtkCallbackMap *CallbackMap;
109 
115  void SetCallbackMethod(unsigned long widgetEvent,
116  vtkAbstractWidget *w, CallbackType f);
117 
118 
119 private:
121  void operator=(const vtkWidgetCallbackMapper&) = delete;
122 
123 };
124 
125 
126 #endif /* vtkWidgetCallbackMapper_h */
127 
vtkEventData
Definition: vtkEventData.h:64
vtkWidgetCallbackMapper::SetCallbackMethod
void SetCallbackMethod(unsigned long VTKEvent, vtkEventData *ed, unsigned long widgetEvent, vtkAbstractWidget *w, CallbackType f)
vtkWidgetCallbackMapper::SetCallbackMethod
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...
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkWidgetCallbackMapper::EventTranslator
vtkWidgetEventTranslator * EventTranslator
Definition: vtkWidgetCallbackMapper.h:105
vtkWidgetCallbackMapper
map widget events into callbacks
Definition: vtkWidgetCallbackMapper.h:42
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:64
vtkWidgetCallbackMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkWidgetCallbackMapper::New
static vtkWidgetCallbackMapper * New()
Instantiate the class.
vtkObject.h
vtkWidgetCallbackMapper::~vtkWidgetCallbackMapper
~vtkWidgetCallbackMapper() override
vtkWidgetCallbackMapper::CallbackMap
vtkCallbackMap * CallbackMap
Definition: vtkWidgetCallbackMapper.h:108
vtkWidgetCallbackMapper::SetCallbackMethod
void SetCallbackMethod(unsigned long VTKEvent, int modifiers, char keyCode, int repeatCount, const char *keySym, unsigned long widgetEvent, vtkAbstractWidget *w, CallbackType f)
vtkWidgetCallbackMapper::vtkWidgetCallbackMapper
vtkWidgetCallbackMapper()
vtkWidgetEvent
define widget events
Definition: vtkWidgetEvent.h:33
vtkWidgetEventTranslator
map VTK events into widget events
Definition: vtkWidgetEventTranslator.h:52
vtkWidgetCallbackMapper::InvokeCallback
void InvokeCallback(unsigned long widgetEvent)
This method invokes the callback given a widget event.
vtkWidgetCallbackMapper::SetEventTranslator
void SetEventTranslator(vtkWidgetEventTranslator *t)
Specify the vtkWidgetEventTranslator to coordinate with.
vtkWidgetCallbackMapper::SetCallbackMethod
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...