[vtk-developers] Problem with Python wrappers

David Gobbi david.gobbi at gmail.com
Fri Jul 15 16:20:22 EDT 2011


On Fri, Jul 15, 2011 at 1:45 PM, Prabhu Ramachandran <prabhu at aero.iitb.ac.in
> wrote:

>
> So it seems like the only way around this is to actually mangle the names
> to make them legitimate as you say below.
>
>  I could change the python names of the template instantiations to a
>> mangled form to make them python-legit,
>>
>> vtkVector3<float> -> 'T10vtkVector3IfE'
>> vtkVector<float,3> -> 'T9vtkVectorIfLi3EE'
>>
>
> Why not, vtkVector3_float or vtkVector3_float_3?  Underscores are not used
> in any other VTK class names.
>

I already have code in VTK to do gcc-style mangling, which is what I showed
above -- it's ugly, but it is a documented standard. Also, the names don't
necessarily have to be human-readable, since the purpose here is to enable
code introspection tools like yours.  Users will still typically instantiate
the templates as vtkVector['float32', 3] as I described in README_WRAP.txt.

I've attached a really simple script.  I have a test suite to catch these so
> once this is fixed I'll report any additional issues.
>
> If you'd like, I can also send you the full wrapper generation code
> off-list.  It only depends on standard Python + VTK-Python.
>

Sure, it might be useful for me to take a peek.

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110715/18506a34/attachment.html>


More information about the vtk-developers mailing list