[vtkusers] Re: Segmentation Fault in Python Code on Linux
Utsav Pardasani
pardasaniman at yahoo.com
Fri Nov 1 14:10:37 EST 2002
An example of what can cause VTK to crash on my machine
Based on ConeTk.py
from Tkinter import *
from vtkpython import *
import vtkpython
from vtkRenderWidget import vtkTkRenderWidget
# Make a root window
root = Tk()
# Add a vtkTkRenderWidget
renderWidget = vtkTkRenderWidget(root,width=400,height=400)
renderWidget.pack(expand='true',fill='both')
# Get the render window from the widget
renWin = renderWidget.GetRenderWindow()
# Next, do the VTK stuff
ren = vtkRenderer()
renWin.AddRenderer(ren)
cone = vtkConeSource()
cone.SetResolution(16)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
#The part that causes it to crash
print coneActor.GetMatrix()
# Make a quit button
def quit():
root.destroy()
button = Button(text="Quit",command=quit)
button.pack(expand='true',fill='x')
# start up the event loop
root.mainloop()
GetMatrix seems to cause VTK to segfault whenever I make any code with it.
Many Thanks
>From Utsav
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
More information about the vtkusers
mailing list