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

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Aug 9 12:51:35 EDT 2006


Hi All,

While you're on this subject, I've a similar simple class that i use 
with tcl. The class just stores the last Error/Warning/Debug text and 
invokes and event. So to print to the wish console you'd use it like this:

    vtkBufferOutputWindow buffer
        buffer SetInstance buffer
        buffer AddObserver ErrorEvent {puts stderr [buffer 
GetLastOutputText]}
        buffer AddObserver WarningEvent {puts stderr [buffer 
GetLastOutputText]}
        buffer AddObserver UserEvent {puts stdout [buffer 
GetLastOutputText]}


Since there is no DebugEvent, I've used the UserEvent instead but this 
could be changed if a vtkCommand::DebugEvent was created. This class 
could be used with any bound language.

Here's the link to the class:

http://www.bioengineering-research.com/vtk/vtkBufferOutputWindow.cxx
http://www.bioengineering-research.com/vtk/vtkBufferOutputWindow.h

Regards,

Goodwin



More information about the vtk-developers mailing list