[vtkusers] Re: [vtk-developers] patch for turning (almost) all VTK errors into Python exceptions, IMPROVED

Charl P. Botha cpbotha at cpbotha.net
Tue Aug 8 11:07:02 EDT 2006


On 8/8/06, David Gobbi <dgobbi at atamai.com> wrote:
> I just want to make sure that an app that uses VTK's built-in main loop
> (i.e. that
> doesn't use a separate GUI toolkit) will also return to the main loop
> after an
> exception.

I just checked with the VolumeRenderWithBoxWidget.py example and
modified the EndInteractionEvent to perform a VTK action that
generates an exception.  The application simply continues when this
happens, as expected.

The code simply results in a Python exception, not a C++-exception.
Python exceptions in general don't result in application exit if
they're not explicitly handled, AFAICR.

Also remember that the old behaviour can be reinstated with:
ow = vtk.vtkOutputWindow()
ow.SetInstance(ow)

So far, I haven't been able to think of any serious drawbacks to this
vtkPythonOutputWindow approach.

HTH,
Charl



More information about the vtkusers mailing list