[vtkusers] python bindings

David Gobbi dgobbi at irus.rri.on.ca
Tue Feb 13 13:39:46 EST 2001


Hi Jan,

Regarding the python wrappers, most of your questions are answered
in the file vtk/python/python.txt (which I'll rename to README.TXT
to make it a bit more obvious).  The missing functions are usually
due to a missing entry in vtk/wrap/hints or due to a missing const
in an argument list.

The best way to handle user interaction though Python is usually
via the vtkRenderWidget.py script in vtk/python.  You can also
hook callbacks into vtkInteractorStyleUser, as demonstrated in
vtk/contrib/SliceViewer.py.

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Tue, 13 Feb 2001, Jan Vittrup Hansen wrote:

> Hi,
> 
>   I've been reading the vtkusers archives to learn more on the vtk 
> python bindings in the current CVS version of VTK under redhat linux 
> 7.0, and have a few questions:
> 
> o Are there any chance of being able to derive my own classes from 
> vtkActor or vtkInteractorStyle in python?
> 
> o Also it seems that a number of functions seems missing from the 
> wrapper, in particular vtkActor.GetBounds()
> would be nice right now - will this change? Can I get around this 
> without modifying the source distribution?
> 
> o I attempted deriving a class from vtkInteractorStyle via C++
> to make some protected methods available as "public" so I could make a 
> python wrapper class emulating derivation.
> This failed miserably since SWIG apparently does not use the information 
> present in the tree already build, hence
> did not accept the vtkInteractorStyle class. Any ideas of how I can 
> "hack" the bindings easily?
> 
>   Regards, Jan...






More information about the vtkusers mailing list