Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Common/vtkCallbackCommand.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCallbackCommand.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00052 #ifndef __vtkCallbackCommand_h
00053 #define __vtkCallbackCommand_h
00054 
00055 #include "vtkCommand.h"
00056 
00057 class VTK_COMMON_EXPORT vtkCallbackCommand : public vtkCommand
00058 {
00059 public:
00060   static vtkCallbackCommand *New() 
00061     {return new vtkCallbackCommand;};
00062 
00067   void Execute(vtkObject *caller, unsigned long eid, void *callData);
00068 
00070 
00072   void SetClientData(void *cd) 
00073     {this->ClientData = cd;}
00074   void* GetClientData()
00075     {return this->ClientData; }
00076   void SetCallback(void (*f)(vtkObject *caller, unsigned long eid, 
00077                              void *clientdata, void *calldata)) 
00078     {this->Callback = f;}
00079   void SetClientDataDeleteCallback(void (*f)(void *))
00080     {this->ClientDataDeleteCallback = f;}
00082   
00083   void *ClientData;
00084   void (*Callback)(vtkObject *, unsigned long, void *, void *);
00085   void (*ClientDataDeleteCallback)(void *);
00086 
00087 protected:
00088   vtkCallbackCommand();
00089   ~vtkCallbackCommand();
00090 };
00091 
00092 
00093 
00094 #endif /* __vtkCallbackCommand_h */
00095