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=========================================================================*/
44#ifndef vtkCallbackCommand_h
45#define vtkCallbackCommand_h
46
47#include "vtkCommand.h"
48#include "vtkCommonCoreModule.h" // For export macro
49
50class VTKCOMMONCORE_EXPORT vtkCallbackCommand : public vtkCommand
51{
52public:
54
55 static vtkCallbackCommand* New() { return new vtkCallbackCommand; }
56
63 void Execute(vtkObject* caller, unsigned long eid, void* callData) override;
64
69 virtual void SetClientData(void* cd) { this->ClientData = cd; }
70 virtual void* GetClientData() { return this->ClientData; }
71 virtual void SetCallback(
72 void (*f)(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata))
73 {
74 this->Callback = f;
75 }
76 virtual void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
77
83 void SetAbortFlagOnExecute(int f) { this->AbortFlagOnExecute = f; }
84 int GetAbortFlagOnExecute() { return this->AbortFlagOnExecute; }
85 void AbortFlagOnExecuteOn() { this->SetAbortFlagOnExecute(1); }
86 void AbortFlagOnExecuteOff() { this->SetAbortFlagOnExecute(0); }
87
88 void (*Callback)(vtkObject*, unsigned long, void*, void*);
89 void (*ClientDataDeleteCallback)(void*);
90
91protected:
94
97};
98
99#endif
100
101// 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:63