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=========================================================================*/
53#ifndef vtkCallbackCommand_h
54#define vtkCallbackCommand_h
55
56#include "vtkCommand.h"
57#include "vtkCommonCoreModule.h" // For export macro
58
59class VTKCOMMONCORE_EXPORT vtkCallbackCommand : public vtkCommand
60{
61public:
63
64 static vtkCallbackCommand* New() { return new vtkCallbackCommand; }
65
72 void Execute(vtkObject* caller, unsigned long eid, void* callData) override;
73
78 virtual void SetClientData(void* cd) { this->ClientData = cd; }
79 virtual void* GetClientData() { return this->ClientData; }
80 virtual void SetCallback(
81 void (*f)(vtkObject* caller, unsigned long eid, void* clientdata, void* calldata))
82 {
83 this->Callback = f;
84 }
85 virtual void SetClientDataDeleteCallback(void (*f)(void*)) { this->ClientDataDeleteCallback = f; }
86
92 void SetAbortFlagOnExecute(int f) { this->AbortFlagOnExecute = f; }
93 int GetAbortFlagOnExecute() { return this->AbortFlagOnExecute; }
94 void AbortFlagOnExecuteOn() { this->SetAbortFlagOnExecute(1); }
95 void AbortFlagOnExecuteOff() { this->SetAbortFlagOnExecute(0); }
96
97 void (*Callback)(vtkObject*, unsigned long, void*, void*);
98 void (*ClientDataDeleteCallback)(void*);
99
100protected:
103
106};
107
108#endif
109
110// 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:72