[vtk-developers] const arrays in Set methods

David Gobbi dgobbi at irus.rri.ca
Wed Nov 28 10:58:11 EST 2001


On Wed, 28 Nov 2001, Brad King wrote:

> > Some of the python code I have doesn't work with the recent VTK 4.0
> > because the SetPosition(float _arg[3]) etc.  methods don't have
> > const arguments and therefore aren't being wrapped.
> Is there a specific class for which the SetPosition method is not showing
> up?  I don't think the VTK wrappers wrap any methods that take array
> arguments unless a hint is specified or the method is defined by a macro
> like vtkSetVector3Macro.

No, as long as the array is declared as const it is wrapped.  I made
that change to vtkParse.y around two years ago or so.

My plan (at least for the python wrappers) was to eventually wrap
non-const arrays as well but to associate them with python lists
instead of with python tuples.  That way the returned array elements
could be copied into the lists.  I never got around to it, but it
would be straightforward to do.

Anyway, I've changed my own VTK source to wrap all arrays and will
probably commit the change later today if there are no objections.
I had to add //BTX //ETX around all VTK methods with parameters
of the form <type>[n][m] because vtkParse.l/vtkParse.y don't
correctly parse multi-dimensional arrays.

 - David






More information about the vtk-developers mailing list