[vtkusers] python-vtk documentation?

Werner Schliemann schliemannw at yahoo.de
Mon Jun 2 18:17:57 EDT 2008


Hello!
I have often problems to find how to get VTK programs running with the python bindings (I'm talking about the python-vtk package in Ubuntu 7.10 Linux), when these behave differently from the C++ classes.

Does a documentation of the python-vtk bindings exist?

And here is one concrete problem:
I added an observer to a vtkRenderWindowInteractor to redraw a window after each TimerEvent. But the observer callback function ("cb" in the code below) is only called while the mouse button is pressed in the window. This has been mentioned previously in this list, but no answers were posted. How can I modify the following code so that the cb() function is called periodically independent from mouse events?

import vtk
sphere = vtk.vtkSphereSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInput(sphere.GetOutput())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin..AddRenderer(ren)
ren.AddActor(actor)

def cb(obj, event):
   print "callback"
   #renWin.Render()

iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.AddObserver("TimerEvent", cb)
iren.Initialize()
iren.Start()

cheers
Werner



      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com




More information about the vtkusers mailing list