VTK internal error messages

Randall Hopper aa8vb at ipass.net
Sun Apr 30 12:12:05 EDT 2000


     When errors are detected by VTK, it returns an error to the scripting
language, but doesn't usually yield a helpful error message describing the
detected problem:

   SystemError: NULL result without error in call_object

     Returning meaningful error messages would be helpful.  This could be
wrapped in a macro so it "does this right thing" for the scripting
language.  In Python for example, VTK would call PyErr_SetString (or
PyErr_Format) to set such a message.  This would be printed instead of the
generic "NULL result without error in call_object".

     Below is a example where the error committed is more obvious than most.
Notice it tries to incorrectly hook a vtkStructuredGridGeometryFilter up
to process a vtkStructuredPoints dataset.

Randall


> python
Python 1.5.2 (#3, Apr 13 2000, 21:30:55)  [GCC 2.7.2.3] on freebsd3
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from libVTKCommonPython import *
>>> from libVTKGraphicsPython import *
>>> import struct
>>> data = struct.pack( "ffffffffffff", 1,1,1,2,2,2,3,3,3,4,4,4 ) 
>>> sp = vtkStructuredPoints()
>>> sp.SetOrigin( 0,0,0 )
>>> sp.SetSpacing( 1,1,1 )
>>> sp.SetDimensions( 3,3,2 )
>>> vectors = vtkVectors()
>>> vectors.GetData().SetVoidArray( data, 2*2*3, 1 )
>>> sp.GetCellData().SetVectors( vectors )
>>> 
>>> print map( sp.GetCellData().GetVectors().GetVector, [0,1,2,3] )
[(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0), (4.0, 4.0, 4.0)]
>>>
>>> plane = vtkStructuredGridGeometryFilter()
>>> plane.SetInput( sp )
Traceback (innermost last):
  File "<stdin>", line 1, in ?
SystemError: NULL result without error in call_object
>>>
>>> plane = vtkStructuredPointsGeometryFilter()
>>> plane.SetInput( sp )
>>>
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list