[vtkusers] Two questions about handling multitouch events in VTK

Joachim Pouderoux joachim.pouderoux at kitware.com
Sat Dec 22 06:54:52 EST 2012


Hi,

AFAIK, Multitouch interaction is not yet supported in vtk. Meanwhile,
you could eventually do something like you described and emulate some
mouse events to an existing mouse interactor but it might be tricky
and difficult to make the interaction smooth. I think the best way
would be to directly handle the multitouch events to setup the camera
settings in the render-interaction loop. You will find on the internet
a lot of c++ or c# classes to compute the camera parameters for a
classical 3d multitouch interaction, and you will just need to set the
renderer active camera with them on each frame.

Joachim

Le 22 déc. 2012 à 08:05, HuaweiTu <tuhuawei09 at gmail.com> a écrit :

> Hi all,
>
> I am working on a project of 3D anatomy visualization on multitouch devices.
> I want to use VTK for 3D visualization and WPF for multitouch interaction.
> One difficult part in this project is how to translate a multitouch event to
> a corresponding mouse event because VTK can handle only mouse events and
> keyboard events. For example, when WPF detects a “zoom in” event, VTK can
> trigger a MouseWheelBackwardEvt event. I have two questions when doing so.
>
> 1.How to trigger a MouseWheelBackwardEvt event in VTK? I did the following
> coding, but it can not work.
> renWin = vtkRenderWindow.New();
> iren = vtkRenderWindowInteractor.New();
> iren.SetRenderWindow(renWin);
>
> vtkInteractorStyleUser interactorStyleUser = vtkInteractorStyleUser.New();
> iren.SetInteractorStyle(interactorStyleUser);
> interactorStyleUser.InvokeEvent((uint)vtkCommand.EventIds.
> MouseWheelBackwardEvent);
>
> 2.A “zoom in” event of WPF has some parameters which are used to describe
> the event, such as x, y coordinates. How to pass the parameters to
> MouseWheelBackwardEvt event in VTK? This one may work:
> SetEventInformation(int x, int y, int ctrl, int shift, sbyte keycode, int
> repeatcount, string keysym), but I do not know how to use it.
>
> I am new to VTK and WPF. So could someone give me some hints to solve these
> problems? Or could someone think better ways to handle multitouch events in
> VTK? PS: Because I am doing this under C# environment, so it would be nice
> to present examples using C# .
>
> I appreciate any help I can get.
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Two-questions-about-handling-multitouch-events-in-VTK-tp5717708.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list