VTK  9.2.6
vtkCallbackCommand.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCallbackCommand.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=========================================================================*/
153#ifndef vtkCallbackCommand_h
154#define vtkCallbackCommand_h
155
156#include "vtkCommand.h"
157#include "vtkCommonCoreModule.h" // For export macro
158
159class VTKCOMMONCORE_EXPORT vtkCallbackCommand : public vtkCommand
160{
161public:
163
164 static vtkCallbackCommand* New() { return new vtkCallbackCommand; }
165
172 void Execute(vtkObject* caller, unsigned long eid, void* callData) override;
173
178 virtual void SetClientData(void* cd) { this->ClientData = cd; }
179 virtual void* GetClientData() { return this->ClientData; }
180 virtual void SetCallback(
181 void (*f)(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata))
182 {
183 this->Callback = f;
184 }
185 virtual void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
186
192 void SetAbortFlagOnExecute(int f) { this->AbortFlagOnExecute = f; }
193 int GetAbortFlagOnExecute() { return this->AbortFlagOnExecute; }
194 void AbortFlagOnExecuteOn() { this->SetAbortFlagOnExecute(1); }
195 void AbortFlagOnExecuteOff() { this->SetAbortFlagOnExecute(0); }
196
197 void (*Callback)(vtkObject*, unsigned long, void*, void*);
198 void (*ClientDataDeleteCallback)(void*);
199
200protected:
203
206};
207
208#endif
209
210// 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:395
abstract base class for most VTK objects
Definition: vtkObject.h:82