VTK internal error messages

David Gobbi dgobbi at irus.rri.on.ca
Sun Apr 30 13:33:24 EDT 2000


Hi Randall,

If VTK detects an error, then it _does_ return a useful error message
in nearly all cases.  The problem you are seeing is a problem with the
Python wrappers, not with the core VTK libraries.

The only time that the 'NULL result without error in call_object'
is when you feed the python wrappers the wrong type of object.  
Yes, the wrappers should detect this, in fact I seem to recall
that they did at one point in time...  it isn't a difficult thing
to fix.


Also a warning:  when you use SetVoidArray(), whether from Python
or C++, you're playing with fire.  In the future the VTK graphics
pipeline will be probably be expanded to deal with both float and
double, and your code expects that vtkVectors are float.  

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario


On Sun, 30 Apr 2000, Randall Hopper wrote:

>      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