[vtkusers] Vtk.js and scroll wheel click

Richard Frank rickfrank at me.com
Tue Sep 4 09:29:07 EDT 2018


Thanks. 

Question - I have this interactor style
https://github.com/DominionSoftware/VTKPlugin/lib/ohifInteractorStyleSlice.js

Which handles zooming by dollying the camera...

The superclass has States.IS_PAN:

So it would seem that if I can get a center button drag event it would be simpler than creating a manipulator as a special case.

The wheel also handles slice navigation.

The “usual” ( for better or worse ) way of panning on these medical slices is by holding down the wheel ( albeit without spinning it ) and dragging. 

So....in my mind it would be the simplest path to handle States.IS_PAN by getting a center button event here and passing it to the super class.

Is there a browser or other event snafu that prevents the center button drag coming through directly to the interactor?

The superclass handles pan with a left drag and modifier combination, while we would like to use center button drag....


Thanks,

Rick

Sent from my iPad

> On Sep 3, 2018, at 11:18 PM, Sebastien Jourdain <sebastien.jourdain at kitware.com> wrote:
> 
> When you register a manipulator you need to specify when it should be applied, button (1,2,3), modifier (alt, shift, control). If you don't specify anything that will be the left button with no modifier.
> Moreover, you can provide those flags to skip drag or scroll (scrollEnabled: true, dragEnabled: false)
> 
> Since that manipulator is only focusing on mouse drag, you will need to create another one that do something base on the scroll like here:
> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js#L70-L90
> 
> You have that example that allow you to dynamically design the user interaction style
> https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleManipulator/example/index.js
> 
> https://kitware.github.io/vtk-js/examples/InteractorStyleManipulator.html
> 
> 
> 
> 
>> On Mon, Sep 3, 2018 at 8:28 PM Richard Frank <rickfrank at me.com> wrote:
>> 
>> 
>>> 
>>> In your case, you may have to implement a panManipulator that only deals with the mouse wheel/pinch.
>> 
>> Do you mean a interactorStyle - hasA - Pan Manipulator?
>> 
>> I tried that and when I add the manipulator it seems to take over all the events…..I don’t get the left or right button - when I created the pan manipulator I only 
>> assigned it center button (2)
>> 
>> 
>>> You can look at the zoom one which has an option to support the mouse wheel.
>> 
>> Do you mean a zoom Manipulator?
>> 
>> I’ll experiment and post some code if I can’t get it working….
>> 
>> Thanks
>> 
>> Rick
>> 
>>> 
>>> HTH,
>>> 
>>> Seb 
>>> 
>>>> On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers <vtkusers at public.kitware.com> wrote:
>>>> Hi
>>>> 
>>>> I want to use scroll wheel down for Pan in my interactor instead of a modifier key. What’s the best way to do this? I don’t see how to get it in an interactor style and if I add a PanManipulator it seems to take over all the mouse handling.
>>>> 
>>>> What’s the relationship between an interactor and a manipulator?
>>>> 
>>>> Thanks
>>>> 
>>>> Rick Frank
>>>> _______________________________________________
>>>> 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:
>>>> https://public.kitware.com/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180904/fe03461a/attachment.html>


More information about the vtkusers mailing list