[vtkusers] mapping a different wrapping to SWIG wrapping

Prabhu Ramachandran prabhu_r at users.sf.net
Sat Feb 19 02:23:06 EST 2005


>>>>> "TF" == tom fogal <tfogal at apollo.sr.unh.edu> writes:

    TF> Hi all, I seem to have hit a wall in terms of application
    TF> structure due to the fact that the VTK library produces its
    TF> own wrapping which is not recognized by SWIG.

    TF> I have a C++ setup that is similar to:

    TF> class Foo {
    TF> 	...  void Bar(vtkDataSet*) const; ...
    TF> };

Why don't you write a typemap for the task.  *Untested* example:

  %typemap (in) vtkDataSet *data_set
  {
      $1 = vtkPythonGetPointerFromObject($input, "vtkDataSet");
  }

You'll need to include vtkPythonUtil.h to be able to use
vtkPythonGetPointerFromObject.

HTH.

cheers,
prabhu



More information about the vtkusers mailing list