VTK  9.2.20221001
vtkOldStyleCallbackCommand.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOldStyleCallbackCommand.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 =========================================================================*/
34 #ifndef vtkOldStyleCallbackCommand_h
35 #define vtkOldStyleCallbackCommand_h
36 
37 #include "vtkCommand.h"
38 #include "vtkCommonCoreModule.h" // For export macro
39 
40 // the old style void fund(void *) callbacks
41 VTK_ABI_NAMESPACE_BEGIN
42 class VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand : public vtkCommand
43 {
44 public:
46 
48 
52  void Execute(vtkObject* invoker, unsigned long eid, void* calldata) override;
53 
55 
58  void SetClientData(void* cd) { this->ClientData = cd; }
59  void SetCallback(void (*f)(void* clientdata)) { this->Callback = f; }
60  void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
62 
63  void* ClientData;
64  void (*Callback)(void*);
65  void (*ClientDataDeleteCallback)(void*);
66 
67 protected:
70 };
71 
72 VTK_ABI_NAMESPACE_END
73 #endif /* vtkOldStyleCallbackCommand_h */
74 
75 // VTK-HeaderTest-Exclude: vtkOldStyleCallbackCommand.h
superclass for callback/observer methods
Definition: vtkCommand.h:396
abstract base class for most VTK objects
Definition: vtkObject.h:83
supports legacy function callbacks for VTK
void SetClientData(void *cd)
Methods to set and get client and callback information.
void Execute(vtkObject *invoker, unsigned long eid, void *calldata) override
Satisfy the superclass API for callbacks.
static vtkOldStyleCallbackCommand * New()
void SetClientDataDeleteCallback(void(*f)(void *))
Methods to set and get client and callback information.
~vtkOldStyleCallbackCommand() override
void SetCallback(void(*f)(void *clientdata))
Methods to set and get client and callback information.