VTK
dox/Common/Core/vtkCallbackCommand.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCallbackCommand.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00043 #ifndef __vtkCallbackCommand_h
00044 #define __vtkCallbackCommand_h
00045 
00046 #include "vtkCommonCoreModule.h" // For export macro
00047 #include "vtkCommand.h"
00048 
00049 class VTKCOMMONCORE_EXPORT vtkCallbackCommand : public vtkCommand
00050 {
00051 public:
00052   vtkTypeMacro(vtkCallbackCommand,vtkCommand);
00053 
00054   static vtkCallbackCommand *New()
00055     {return new vtkCallbackCommand;};
00056 
00061   virtual void Execute(vtkObject *caller, unsigned long eid, void *callData);
00062 
00064 
00066   virtual void SetClientData(void *cd)
00067     { this->ClientData = cd; }
00068   virtual void* GetClientData()
00069     { return this->ClientData; }
00070   virtual void SetCallback(void (*f)(vtkObject *caller, unsigned long eid,
00071                                      void *clientdata, void *calldata))
00072     { this->Callback = f; }
00073   virtual void SetClientDataDeleteCallback(void (*f)(void *))
00074     { this->ClientDataDeleteCallback = f; }
00076 
00078 
00081   void SetAbortFlagOnExecute(int f)
00082     { this->AbortFlagOnExecute = f; }
00083   int GetAbortFlagOnExecute()
00084     { return this->AbortFlagOnExecute; }
00085   void AbortFlagOnExecuteOn()
00086     { this->SetAbortFlagOnExecute(1); }
00087   void AbortFlagOnExecuteOff()
00088     { this->SetAbortFlagOnExecute(0); }
00090 
00091   void (*Callback)(vtkObject *, unsigned long, void *, void *);
00092   void (*ClientDataDeleteCallback)(void *);
00093 
00094 protected:
00095 
00096   int AbortFlagOnExecute;
00097   void *ClientData;
00098 
00099   vtkCallbackCommand();
00100   ~vtkCallbackCommand();
00101 };
00102 
00103 #endif
00104 
00105 // VTK-HeaderTest-Exclude: vtkCallbackCommand.h