[vtkusers] vtkWrapPython and function-pointers

Charl P. Botha cpbotha at gmail.com
Mon Oct 31 07:50:53 EST 2005


On 10/31/05, Jens <jens-devel at gmx.de> wrote:
> I just read this article:
> http://www.swig.org/Doc1.1/HTML/Python.html#n11
> It seems not to be that easy.
>
> Does anybody has an idea how to exclude a function from getting wrapped by
> vtkWrapPython so that no error occurs?
>
>         Greeting
>                 Jens
>
> Am Montag, 31. Oktober 2005 13:08 schrieb Jens:
> > Hi
> > I´m developing a new reader class for vtk and would like to be able to wrap
> > it for python, too.
> > Starting with the class vtkLocal it worked fine until I added the following
> > function definition in the header file:
> >
> > SetGridLoadingFeedback( void (*GridFeedbackFunc)(const int) );
> >
> > The class still compiles without errors but cannot get wrapped using
> > Vtk/bin/vtkWrapPython.
> >
> > Changing the function definition to
> > SetGridLoadingFeedback( void (*GridFeedbackFunc)(void *) );
> > removes the error, but I want an "const int" and no "void*" as function
> > argument.
> >
> > Does anybody knows if this is a python related restriction or what I could
> > do?

In the header file, surround the offending method declaration with
//BTX on the line before and //ETX on the line after.  Search for
occurrences of BTX/ETX in other VTK header files to see an example of
this.

Good luck,
Charl

--
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtkusers mailing list