[vtkusers] Subclasses for vtkInteractorStyle

Charl P. Botha c.p.botha at its.tudelft.nl
Mon Jun 24 16:01:27 EDT 2002

On Mon, Jun 24, 2002 at 01:32:50PM -0600, Walter E Voit wrote:
> I am a summer student new to vtk working on a visual editor.  I want to 
> change some of the user interaction buttons like changing the "left mouse 
> button click" to pick a cell instead of scroll around.
> As far as I can tell, the way to subclass vtkInteractorStyle and its 
> derived classes deals with the Object Factory.  However, I can't figure out 
> how to have a program use functions from the class I created instead of 
> using the functions from the classes in the library.

You could subclass the vtkInteractorStyle.  For what you're doing however,
VTK 4.x has a much better mechanism.  You can attach an arbitrary number of
observers to e.g. the RenderWindowInteractor.  This more or less follows the
Observer design pattern (doh).  Have a look at the AddObserver method of the

charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/

More information about the vtkusers mailing list