00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00043 #ifndef __vtkCallbackCommand_h
00044 #define __vtkCallbackCommand_h
00045
00046 #include "vtkCommand.h"
00047
00048 class VTK_COMMON_EXPORT vtkCallbackCommand : public vtkCommand
00049 {
00050 public:
00051 static vtkCallbackCommand *New()
00052 {return new vtkCallbackCommand;};
00053
00058 virtual void Execute(vtkObject *caller, unsigned long eid, void *callData);
00059
00061
00063 virtual void SetClientData(void *cd)
00064 { this->ClientData = cd; }
00065 virtual void* GetClientData()
00066 { return this->ClientData; }
00067 virtual void SetCallback(void (*f)(vtkObject *caller, unsigned long eid,
00068 void *clientdata, void *calldata))
00069 { this->Callback = f; }
00070 virtual void SetClientDataDeleteCallback(void (*f)(void *))
00071 { this->ClientDataDeleteCallback = f; }
00073
00075
00078 void SetAbortFlagOnExecute(int f)
00079 { this->AbortFlagOnExecute = f; }
00080 int GetAbortFlagOnExecute()
00081 { return this->AbortFlagOnExecute; }
00082 void AbortFlagOnExecuteOn()
00083 { this->SetAbortFlagOnExecute(1); }
00084 void AbortFlagOnExecuteOff()
00085 { this->SetAbortFlagOnExecute(0); }
00087
00088 void (*Callback)(vtkObject *, unsigned long, void *, void *);
00089 void (*ClientDataDeleteCallback)(void *);
00090
00091 protected:
00092
00093 int AbortFlagOnExecute;
00094 void *ClientData;
00095
00096 vtkCallbackCommand();
00097 ~vtkCallbackCommand();
00098 };
00099
00100 #endif
00101