[vtkusers] How can I implement user defined mouse drag event?

David Doria daviddoria at gmail.com
Mon Feb 20 09:49:57 EST 2012


On Mon, Feb 20, 2012 at 9:26 AM, yarram <somasekhar.vit at gmail.com> wrote:
> Hi, I am using "vtkInteractionStyleImage" as interaction style, and using
> "addObserver" method for user defined actions. And by default, the actor
> rotates if it is dragged with mouse. Now I want to define my own actions on
> mouse drag i.e., on dragging an actor, it shouldn't rotate the actor. How
> can I do this??? Please help me and thanks in advance.........

You should subclass the interactor and reimplement the functions you
want to change:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents

In this case you'd probably want OnMouseMove().

David



More information about the vtkusers mailing list