[vtkusers] wx python scripts segfault
David Doria
daviddoria+vtk at gmail.com
Sat Feb 27 12:34:17 EST 2010
On Sat, Feb 27, 2010 at 11:57 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> My only advice is to use wxRenderWindow instead. Regardless of the
> name, it actually does provide interaction, and most importantly, it
> doesn't crash like wxRenderWindowInteractor does (or at least, not on
> my ubuntu 8.04 system).
>
> The difference between the two classes is that wxRenderWindow does the
> interaction purely in python, while wxRenderWindowInteractor uses a
> vtkGenericRenderWindowInteractor. (Note: this difference is probably
> unrelated to the crash).
>
> If wxRenderWindow doesn't serve your purpose and you need
> wxRenderWindowInteractor, then I suggest that the best way to debug it
> is to work your way backward from any instances of SetWindowInfo,
> SetParentInfo, or SetNextWindowInfo that appear in the code. Add lots
> of print statements to the python code so that you can correlate the
> C++ stack trace to a position in the python code. Also, take a look
> at vtkXOpenGLRenderWindow.cxx to see what SetWindowId and related
> methods are doing under-the-hood.
>
> Unfortunately I'm not very familiar with wxPython anymore (it's been
> around eight years since I've used it), but I hope my limited memory
> has provided some help.
>
> David
>
David G,
Thanks for looking at this. You are right that wxVTKRenderWindow doesn't
crash. You didn't say explicitly - did wxVTKRenderWindowInteractor crash on
your system, too?
Can you get the interactor from the widget as a vtkRenderWindowInteractor? I
tried to do this:
widget = wxVTKRenderWindow(frame, -1)
style = vtk.vtkInteractorStyleTrackballActor()
widget.GetRenderWindow().GetInteractor().SetInteractorStyle(style)
but I get:
widget.GetRenderWindow().GetInteractor().SetInteractorStyle(style)
AttributeError: 'NoneType' object has no attribute 'SetInteractorStyle'
I guess this means that GetInteractor() is returning the equivalent of NULL?
If I can get this line to work then I'll be back in familiar VTK land and
out of wx land...
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100227/306da7b9/attachment.htm>
More information about the vtkusers
mailing list