[vtkusers] altering a widgets response to mouse clicks

Cory Quammen cory.quammen at kitware.com
Sun Aug 9 22:05:41 EDT 2015


Totte,

The typical way to do this would be to subclass vtkInteractorStyle and
override the member functions

OnLeftButtonDown()
OnLeftButtonUp()
OnMiddleButtonDown()
OnMiddleButtonUp()

to swap the functionality of the two. My guess is that you are using the
vtkInteractorStyleTrackballActor, so you could subclass it and swap the
definitions of the above member functions. Then, set an instance of your
new class as the interactor style in your vtkRenderWindowInteractor.

Hope that helps,
Cory



On Sun, Aug 9, 2015 at 7:17 PM, Totte Karlsson <totte at dunescientific.com>
wrote:

> Hello,
> When using a boxwidget, pressing the left button and moving the mouse
> allow the user to rotate the widget,
> while pressing the middle button and moving the mouse translates the
> widget.
>
> How can I switch the behavior of those two buttons?
> I.e. having the left button doing the translation and the middle button
> the rotation?
>
> -tk
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150809/fdceafd9/attachment.html>


More information about the vtkusers mailing list