[vtkusers] Question about Callbacks

Lledo Museros Cabedo lledo.museros at itc.uji.es
Wed May 2 11:58:38 EDT 2007


Hi,
 
I am implementing some callbacks in C++, and up to now I success to
implement them, but I have a question. I have tried to pass some data to
the callback, in the Execute method by using the calldata as it is
specified:
"
virtual void vtkCommand::Execute 	( 	 vtkObject
<file:///E:/VTK/Documentation/html/a01761.html>  * 	 caller, 	
		unsigned long 	 eventId, 	
		void * 	 callData	
	) 	 [pure virtual]	
All derived classes of vtkCommand must implement this method. This is
the method that actually does the work of the callback. The caller
argument is the object invoking the event, the eventId parameter is the
id of the event, and callData parameter is data that can be passed into
the execute method. (Note: vtkObject::InvokeEvent()
<file:///E:/VTK/Documentation/html/a01761.html#a8>  takes two
parameters: the event id (or name) and call data. Typically call data is
NULL, but the user can package data and pass it this way. Alternatively,
a derived class of vtkCommand can be used to pass data.) "
 
But up to now I have not been able to pass any data as calldata. 
 
Can someone send an example of it or explain how to do this?
 
Thank you in advance,
LLEDO
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070502/67d3937c/attachment.htm>


More information about the vtkusers mailing list