VTK
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 =========================================================================*/
43 #ifndef vtkCallbackCommand_h
44 #define vtkCallbackCommand_h
45 
46 #include "vtkCommonCoreModule.h" // For export macro
47 #include "vtkCommand.h"
48 
50 {
51 public:
53 
55  {return new vtkCallbackCommand;};
56 
61  virtual void Execute(vtkObject *caller, unsigned long eid, void *callData);
62 
64 
66  virtual void SetClientData(void *cd)
67  { this->ClientData = cd; }
68  virtual void* GetClientData()
69  { return this->ClientData; }
70  virtual void SetCallback(void (*f)(vtkObject *caller, unsigned long eid,
71  void *clientdata, void *calldata))
72  { this->Callback = f; }
73  virtual void SetClientDataDeleteCallback(void (*f)(void *))
74  { this->ClientDataDeleteCallback = f; }
76 
78 
82  { this->AbortFlagOnExecute = f; }
84  { return this->AbortFlagOnExecute; }
86  { this->SetAbortFlagOnExecute(1); }
88  { this->SetAbortFlagOnExecute(0); }
90 
91  void (*Callback)(vtkObject *, unsigned long, void *, void *);
92  void (*ClientDataDeleteCallback)(void *);
93 
94 protected:
95 
97  void *ClientData;
98 
101 };
102 
103 #endif
104 
105 // VTK-HeaderTest-Exclude: vtkCallbackCommand.h
virtual void Execute(vtkObject *caller, unsigned long eventId, void *callData)=0
virtual void SetClientData(void *cd)
abstract base class for most VTK objects
Definition: vtkObject.h:61
static vtkCallbackCommand * New()
#define VTKCOMMONCORE_EXPORT
virtual void SetClientDataDeleteCallback(void(*f)(void *))
void SetAbortFlagOnExecute(int f)
virtual void * GetClientData()
superclass for callback/observer methods
Definition: vtkCommand.h:325
supports function callbacks
virtual void SetCallback(void(*f)(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata))