<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 8/9/2015 7:05 PM, Cory Quammen wrote:<br>
<blockquote
cite="mid:CAB5Fpx5-rXrvqzLJkhYz1LmCrrmafAcxHov=qeCrCM+rqwKApA@mail.gmail.com"
type="cite">
<div dir="ltr">Totte,
<div><br>
</div>
<div>The typical way to do this would be to subclass
vtkInteractorStyle and override the member functions</div>
<div><br>
</div>
<div>OnLeftButtonDown()</div>
<div>OnLeftButtonUp()</div>
<div>OnMiddleButtonDown()</div>
<div>OnMiddleButtonUp()</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
</div>
</blockquote>
<br>
Thanks for the response,<br>
<br>
I have now a subclassed a TrackballActor interactor which I am
passing to the widget. <br>
<br>
However, the subclassed interactors On*Button() functions are NOT
called as the widget is visible and clicked on. Those overloaded
functions are only called if clicking outside the widget. <br>
<br>
I have used the slider widget, and for that one, when clicked on,
the interactors onMouse events are indeed called. The box widget
seem to behave differently.<br>
<br>
In addition, as the widget is activated, and an associated callback
Execute function is called, only one type of event is detected, even
though I have added observers for other events. <br>
E.g.<br>
mWidget->AddObserver(vtkCommand::RightButtonPressEvent,
mCallBack); //These are not passed on to the widgets
callback??<br>
mWidget->AddObserver(vtkCommand::RightButtonReleaseEvent,
mCallBack);<br>
mWidget->AddObserver(vtkCommand::InteractionEvent,
mCallBack); //Only this one seem to be relevant??<br>
<br>
I am certainly getting something wrong?<br>
<br>
tk<br>
<br>
<br>
<br>
<blockquote
cite="mid:CAB5Fpx5-rXrvqzLJkhYz1LmCrrmafAcxHov=qeCrCM+rqwKApA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hope that helps,</div>
<div>Cory</div>
<div><span style="color:rgb(0,0,0);font-family:monospace;font-size:12px;white-space:pre">
</span></div>
<div><span style="color:rgb(0,0,0);font-family:monospace;font-size:12px;white-space:pre">
</span></div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Aug 9, 2015 at 7:17 PM, Totte
Karlsson <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:totte@dunescientific.com" target="_blank">totte@dunescientific.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
When using a boxwidget, pressing the left button and moving
the mouse allow the user to rotate the widget,<br>
while pressing the middle button and moving the mouse
translates the widget.<br>
<br>
How can I switch the behavior of those two buttons?<br>
I.e. having the left button doing the translation and the
middle button the rotation?<br>
<br>
-tk<br>
_______________________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" rel="noreferrer"
target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a
moz-do-not-send="true"
href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer"
target="_blank"><a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a></a><br>
<br>
Search the list archives at: <a moz-do-not-send="true"
href="http://markmail.org/search/?q=vtkusers"
rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/vtkusers"
rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.</div>
</div>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<hr size="1">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><a moz-do-not-send="true"
href="http://www.dunescientific.com/" target="_blank"><img
moz-do-not-send="true"
src="http://www.dunescientific.com/images/email/ds_logo_233x60.png"
alt="" border="0" height="40"></a></td>
<td><img moz-do-not-send="true"
src="http://www.dunescientific.com/images/email/spacer.gif"
alt="" border="0" height="1" width="15"></td>
<td bgcolor="#cccccc"><img moz-do-not-send="true"
src="http://www.dunescientific.com/images/email/spacer.gif"
alt="" border="0" height="1" width="1"></td>
<td><img moz-do-not-send="true"
src="http://www.dunescientific.com/images/email/spacer.gif"
alt="" border="0" height="1" width="10"></td>
<td>
<div style="font-size:10px;color:#666666"> Totte Karlsson:
<a moz-do-not-send="true"
href="mailto:totte@dunescientific.com" target="_blank">totte@dunescientific.com</a>
or <a moz-do-not-send="true"
href="tel:%20425%20%20780-9648" value="+14257809648"
target="_blank">(425) 780-9648</a><br>
<a moz-do-not-send="true"
href="http://www.dunescientific.com/" target="_blank">http://www.dunescientific.com/</a>
<br>
© 2015 Dune Scientific, LLC. All rights reserved. </div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
</body>
</html>