[vtkusers] Re: requirements for Python wrapping

Nick Hu nhu at sten.sunnybrook.utoronto.ca
Fri Jun 18 14:23:33 EDT 2004


Tom,

>From my experience, if you use this C++ without vtk environment, there are
some tools which could wrap the c++ with python. Swig is one of them but I
remember you still have to write some C++ code as interpolator. If you will
use your C++ code as part of vtk application, the best way is to write it as
a new vtk class. Whenever you need a pointer to an array, you convert the
array to some data structures in vtk, such as vtkDataArray, and pass that
vtkobject to your python program.

And also, David Ghobbi, who works at Robarts Institute, wrote something
about it:

http://www.imaging.robarts.ca/coders/content/seminars/Wrapping/tutotial01.htm

It is worth to read if you want more details about how vtk wraps the code
with python.

Good luck,

Nick

>
> Message: 1
> Date: Fri, 18 Jun 2004 11:53:02 -0400
> From: tom fogal <tfogal at apollo.sr.unh.edu>
> Subject: [vtkusers] requirements for Python wrapping
> To: vtkusers at vtk.org
> Message-ID: <200406181553.i5IFr2Wf007702 at apollo.sr.unh.edu>
>
> I have some in a C++ object that is not getting wrapped into python for
some
> reason.
>
> What are the requirements for a function to be wrapped into other
languages,
> python specifically? In Wrapping/Python/README_WRAP.txt it says that a
> function will not be wrapped if it returns a pointer to an array; the
function
> in question takes a pointer to an array as an argument, so I'm wondering
if
> perhaps the wrappper-generating program needs some kind of alternative
'hint' ?
>
> Thanks,
>
> -tom




More information about the vtkusers mailing list