[vtkusers] altering a widgets response to mouse clicks

Cory Quammen cory.quammen at kitware.com
Mon Aug 10 22:39:12 EDT 2015


> I have now a subclassed a TrackballActor interactor which I am passing to
> the widget.
>
> 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.
>

In that case, perhaps you need to subclass vtkBoxWidget and override the
same member functions. It is likely processing the mouse button clicks and
not passing the event on to your custom interactor. Sorry for sending you
down that path.

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.
>
> 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.
> E.g.
>     mWidget->AddObserver(vtkCommand::RightButtonPressEvent, mCallBack);
>         //These are not passed on to the widgets callback??
>     mWidget->AddObserver(vtkCommand::RightButtonReleaseEvent, mCallBack);
>     mWidget->AddObserver(vtkCommand::InteractionEvent, mCallBack);
>             //Only this one seem to be relevant??
>
> I am certainly getting something wrong?
>
> tk
>
>
>
> 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>
>> 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>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.
>
>
> --
> ------------------------------
> <http://www.dunescientific.com/>
> Totte Karlsson: totte at dunescientific.com or (425) 780-9648
> <%20425%20%20780-9648>
> http://www.dunescientific.com/
> © 2015 Dune Scientific, LLC. All rights reserved.
>
>
>
> _______________________________________________
> 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/20150810/8d390dba/attachment.html>


More information about the vtkusers mailing list