[vtkusers] connecting wrapped VTK and swig output

Amy Squillacote ahs at cfdrc.com
Wed Feb 13 13:50:03 EST 2008

Hi all,

I have written some C++ code that makes use of VTK, including using VTK 
objects as parameters and return values for some methods. My VTK is from 
CVS on 1/22/08. It is wrapped in Tcl, Python, and Java. I am trying to 
wrap the C++ code I have written into Java and Python. Since my new 
classes are not subclasses of vtkObject, I don't think I can use the 
wrappers in VTK. (Please correct me if I am wrong about this.) Thus, I 
am trying to use swig to do the wrapping since it can output wrappers in 
both Java and Python. The problem is that the swig wrapping isn't aware 
of VTK, so for example, it creates objects of type 
SWIGTYPE_p_vtkPolyData to hold vtkPolyData* in the wrapped languages. 
I'm not sure how to make the conversion between this and the vtkPolyData 
that's wrapped in Java by VTK.

Related to this, I saw this message from a few years ago on the vtkusers 
However, it only applies to python-wrapping, and I need java-wrapping as 

Does anyone have experience with mixing swig-wrapped code and 
VTK-wrapped code?

- Amy

Amy Squillacote                    Phone: (256) 726-4839
Computer Scientist                 Fax: (256) 726-4806
CDF Research Corporation           Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL  35805

More information about the vtkusers mailing list