VTK  9.4.20241123
vtkCallbackCommand.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
141#ifndef vtkCallbackCommand_h
142#define vtkCallbackCommand_h
143
144#include "vtkCommand.h"
145#include "vtkCommonCoreModule.h" // For export macro
146
147VTK_ABI_NAMESPACE_BEGIN
148class VTKCOMMONCORE_EXPORT vtkCallbackCommand : public vtkCommand
149{
150public:
152
153 static vtkCallbackCommand* New() { return new vtkCallbackCommand; }
154
161 void Execute(vtkObject* caller, unsigned long eid, void* callData) override;
162
167 virtual void SetClientData(void* cd) { this->ClientData = cd; }
168 virtual void* GetClientData() { return this->ClientData; }
169 virtual void SetCallback(
170 void (*f)(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata))
171 {
172 this->Callback = f;
173 }
174 virtual void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
175
181 void SetAbortFlagOnExecute(int f) { this->AbortFlagOnExecute = f; }
182 int GetAbortFlagOnExecute() { return this->AbortFlagOnExecute; }
183 void AbortFlagOnExecuteOn() { this->SetAbortFlagOnExecute(1); }
184 void AbortFlagOnExecuteOff() { this->SetAbortFlagOnExecute(0); }
185
186 void (*Callback)(vtkObject*, unsigned long, void*, void*);
187 void (*ClientDataDeleteCallback)(void*);
188
189protected:
192
195};
196
197VTK_ABI_NAMESPACE_END
198#endif
199
200// VTK-HeaderTest-Exclude: vtkCallbackCommand.h
supports function callbacks
~vtkCallbackCommand() override
virtual void SetClientDataDeleteCallback(void(*f)(void *))
virtual void * GetClientData()
void SetAbortFlagOnExecute(int f)
Set/Get the abort flag on execute.
virtual void SetCallback(void(*f)(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata))
virtual void SetClientData(void *cd)
Methods to set and get client and callback information, and the callback function.
static vtkCallbackCommand * New()
void Execute(vtkObject *caller, unsigned long eid, void *callData) override
Satisfy the superclass API for callbacks.
superclass for callback/observer methods
Definition vtkCommand.h:384
abstract base class for most VTK objects
Definition vtkObject.h:162