[vtkusers] Experimental enhanced wrappers for VTK

David Gobbi david.gobbi at gmail.com
Fri May 7 19:09:18 EDT 2010


Hi All,

I've been working on some changes to the VTK wrappers and am hoping
that there are some people here who are willing to try them out and
let me know if anything breaks.  So far, I've only been testing them
on the Mac and occasionally on Linux.

How to get them:
git clone git at github.com:dgobbi/VTK.git VTKnew

The new features:
* fixed support for vtkStdString parameters in all wrapper languages
* support for vtkUnicodeString parameters in python
* support for vtkVariant in python
* fixed selection of overloaded methods based on provided argument
types in python

Overall, this represents a fix to the Tcl and Java wrappers (for
vtkStdString) and a significant enhancement to the Python wrappers.

The most significant change to the python wrappers is support for
special types like vtkVariant.  There is a new property called
VTK_WRAP_SPECIAL that can be set for special types (i.e. types that
start with ''vtk' but aren't derived from vtkObjectBase) that will
allow those types to be used from Python.  The methods of these
special types are wrapped, but not operators like "+" or "-".  Of
course, after a new special type is wrapped, the //BTX and //ETX
markers in all header files have to be removed from methods that use
that type.

For vtkVariant, the following features are not yet implemented:
1) the ToNumeric method, because it's templated
2) operators, except for "<<" via python "print" and "str()"
3) the "valid" parameter

In addition to vtkVariant, the vtkVariantCreate(),
vtkVariantExtract(), and vtkVariantCast() functions are available.

   David



More information about the vtkusers mailing list