[vtkusers] VTK and SWIG

Wayne Christopher wayne at 4raccoons.com
Mon May 23 17:33:39 EDT 2011


I have a python vtkPolyData object that I would like to pass to a 
swigged C++ routine, which takes a vtkPolyData* as an argument.

Based on the discussion in 
http://www.vtk.org/pipermail/vtkusers/2003-October/070054.html, I tried 
passing in mypolydata.__this__.  This value seems to be a string like 
'_0000000006ffe330_p_vtkPolyData'.  However, my swig wrapper fails with

TypeError: in method 'MyClass_MyMethod', argument 2 of type 'vtkPolyData *'

When I look at other swig pointers, they all seem to be of the form

<Swig Object of type 'MyClass *' at 0x5e5c420>

Is this a sign that the vtk __this__ mechanism works only with an older 
swig version?  Is there a workaround?  (Other than passing in the actual 
pointer as an integer and casting it to a vtkPolyData* ?)

Thanks,

     Wayne



More information about the vtkusers mailing list