VTK  9.1.0
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
41class VTKCOMMONCORE_EXPORT vtkOldStyleCallbackCommand : public vtkCommand
42{
43public:
45
47
51 void Execute(vtkObject* invoker, unsigned long eid, void* calldata) override;
52
54
57 void SetClientData(void* cd) { this->ClientData = cd; }
58 void SetCallback(void (*f)(void* clientdata)) { this->Callback = f; }
59 void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
61
63 void (*Callback)(void*);
64 void (*ClientDataDeleteCallback)(void*);
65
66protected:
69};
70
71#endif /* vtkOldStyleCallbackCommand_h */
72
73// VTK-HeaderTest-Exclude: vtkOldStyleCallbackCommand.h
superclass for callback/observer methods
Definition: vtkCommand.h:394
abstract base class for most VTK objects
Definition: vtkObject.h:73
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.