[vtkusers] command/observer..

bob green lost_bits1110 at hotmail.com
Fri Sep 12 23:05:14 EDT 2003


hello

I dont understand following piece of code in the Cone example (contained in 
the Examples/Tutorials/Step2/Python folder found on the VTK site...)

first they define the callback as so:

def myCallback(obj,str):
    print "Starting a render"

and later on they have the observer:

ren1.AddObserver("StartEvent", myCallback)

These are the only two places in the code where you see 'myCallback'... So 
where exactly did they enter the 'obj' and 'str' parameters in here...??? 
and how does Python know that 'myCallback' is a vtkCommand ???

Similarly, there are these lines for example:

cone = vtk.vtkConeSource()
....
coneMapper = vtk.vtkPolyDataMapper()
....
ren1.SetBackground( 0.1, 0.2, 0.4 )

but cone, coneMapper, and ren1 are nowhere defined or initialized or 
anything...?!??!?

Thanks for your help...!

Lost Bits

_________________________________________________________________
Get 10MB of e-mail storage! Sign up for Hotmail Extra Storage.  
http://join.msn.com/?PAGE=features/es




More information about the vtkusers mailing list