[vtkusers] c api and python and vtk

rharder at uiuc.edu rharder at uiuc.edu
Tue Jan 27 13:28:41 EST 2004


Hi,
I have a problem.  It's probably easy, but the available
documentation is not making it obvious.

I have a set of C codes that manipulate a data structure, one
component of which is an array of doubles.  I've managed to
wrap the C codes with SWIG so I have access to the structure
with the typical SWIG accessor functions, i.e. Sp4Array_data_get()
What do I have to do to get this data array into vtk?
data is declared within the structure as double* data.

I would like to avoid using Numarray or Numeric,  I think I 
should write a short C++ function to move the data to a
vtk datatype and the pass it back to python to impliment the
visualization.  How do I do that, assuming that is what's needed?
I don't get how my C++ instantiation of a vtk datatype is 
passed back to a python instantiation of the same type.

I may not be able to see the forest for the trees, this is my
first forray into python and vtk.  Thanks in advance for any
help you can offer.

Ross




More information about the vtkusers mailing list