[vtkusers] Threading with vtkRenderWidget and Python?

Utsav Pardasani pardasaniman at yahoo.com
Tue Jan 7 12:46:26 EST 2003


Hello friends.  I would like to make a multithreaded application with VTK and python. Is it able
to work?  I attempted to do a simple example and it is unable to execute. Can somebody verify it?

from Tkinter import * 
from vtkpython import *
import thread 
from vtkRenderWidget import vtkTkRenderWidget
root = Tk()  
def function():
    renderWidget = vtkTkRenderWidget(root,width=400,height=400) 
    renderWidget.pack(expand='true',fill='both') 
    renWin = renderWidget.GetRenderWindow() 
    ren = vtkRenderer() 
    renWin.AddRenderer(ren) 
    cone = vtkCylinderSource() 
    cone.SetRadius(0.5)
    cone.SetHeight(10)
    cone.SetResolution(16)
    coneMapper = vtkPolyDataMapper() 
    coneMapper.SetInput(cone.GetOutput()) 
    coneActor = vtkActor() 
    coneActor.SetMapper(coneMapper) 
    ren.AddActor(coneActor) 

root.mainloop()
thread.start_new_thread(function,())

Many Thanks,
Utsav

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the vtkusers mailing list