[vtk-developers] vtkVector class -- proposed rewrite

David Gobbi david.gobbi at gmail.com
Mon Jul 25 15:22:13 EDT 2011


On Mon, Jul 25, 2011 at 12:17 PM, David Lonie <loniedavid at gmail.com> wrote:
>
> Would using a typedef be possible for the wrappers? e.g. "typedef
> vtkVector<float, 3> vtkVector3f"? That would eliminate most of the
> complexity in this patch.

Right now, no, it won't work, but it would be easy to make it work,
easier than handling the macro expansion (would it make the macro
expansion unnecessary, though?)

The type vtkVector<float, 3> would then be bound to two different
names in the wrappers: the original templated name, and the typedef'd
name.  Both names would refer to the same python class.

One advantage of using subclasses (like the current vtkVector
implementation) is that vtkVector3f is its own class, instead of just
being an alias.  There is a chance that some introspection tools might
misbehave if types are aliased.

 - David



More information about the vtk-developers mailing list