[vtkusers] vtk AddObserver C++ (not understood)

Abhishek gattani at aktina.com
Tue May 10 18:10:35 EDT 2005


Hello All, 
 
I am a little confused using vtk's AddObserver feature in C++. Most of the
existing examples are in TCL where it is very easy to simply pass a
procedure that gets called on an event. In C++, to add an observer a class
needs to be first derived from vtkCommand and then the execute method must
be overwritten. Within my Execute method how can I get pointers to multiple
objects such as the vtkRenderer, vtkInteractor, or vtkCellPicker? VTK mouse
picking article in Wikipedia, uses picker, iren and ren1 (3 object pointers)
in procedure cbLBR(). While, in C++ my vtkCommand derived class gets one
vtkObject*. I hope I have been clear in explaining my problem. I do
obviously not understand something simple here. Can someone please comment
and guide me to C++ examples that demonstrate. Further, the wikipedia
article mentioned that the C++ example is also available. Where can I get
access to it? Many thanks.

 

-Cheers,

Abhishek 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050510/8b1c9926/attachment.htm>


More information about the vtkusers mailing list