VTK  9.5.20250904
vtkOldStyleCallbackCommand.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
22#ifndef vtkOldStyleCallbackCommand_h
23#define vtkOldStyleCallbackCommand_h
24
25#include "vtkCommand.h"
26#include "vtkCommonCoreModule.h" // For export macro
27#include "vtkDeprecation.h" // For deprecation macro
28
29// the old style void fund(void *) callbacks
30VTK_ABI_NAMESPACE_BEGIN
32 "Legacy command, do not use anymore.") VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand
33 : public vtkCommand
34{
35public:
37
39
43 void Execute(vtkObject* invoker, unsigned long eid, void* calldata) override;
44
46
49 void SetClientData(void* cd) { this->ClientData = cd; }
50 void SetCallback(void (*f)(void* clientdata)) { this->Callback = f; }
51 void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
53
55 void (*Callback)(void*);
56 void (*ClientDataDeleteCallback)(void*);
57
58protected:
61};
62
63VTK_ABI_NAMESPACE_END
64#endif /* vtkOldStyleCallbackCommand_h */
65
66// VTK-HeaderTest-Exclude: vtkOldStyleCallbackCommand.h
superclass for callback/observer methods
Definition vtkCommand.h:384
abstract base class for most VTK objects
Definition vtkObject.h:162
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.
#define VTK_DEPRECATED_IN_9_6_0(reason)