[vtkusers] Handling multi-touch gestures in VTK

Pierre Fillard pierre.fillard at gmail.com
Wed Sep 15 05:06:54 EDT 2010


Hello,


I always wanted to use multi-touch gestures such as the pinching, rotating,
or swiping features of recent apple's computers in VTK to control zooming,
spining and panning of my objects in 3D.


Maybe this was already integrated in the VTK master branch (though I didn't
see it) or planned to be integrated. But to support my needs, I added
support for those new gesture interactions in VTK by adding three new events
in the vtkCommand class:
- PinchGestureEvent
- RotateGestureEvent
- SwipeGestureEvent


I wrote interfaces in the vtkCocoaGLView class to translate Cocoa's events
into those, and I wrote callbacks to handle them properly in
vtkInteractorStyleTrackballCamera just as a proof of concept.

Moreover, Qt 4.6 proposes gesture events (QGestureEvents) that I properly
interfaced in the QVTKWidget class.


Thus, with these modifications, using either a Cocoa RenderWindow or a
QVTKWidget instance, one is able to zoom by pinching, rotate by drawing a
circle on a multi-touch device or panning by (long-)taping on the trackpad.


If anyone is interested, I would be happy to share the code, or even give it
to kitware for review / integration.


Anyone can access it anonymously here. These are just files which should be
replaced in your VTK source tree:

svn checkout svn://
scm.gforge.inria.fr/svn/parietal-public/Utilities/VTKMultiTouch


Note that modifications are based on VTK 5.6 and Qt 4.6. And you need a
multi-touch device, of course.


Cheers,
Pierre.

-- 
Pierre Fillard, Ph.D.,
Research Scientist
INRIA Parietal - Neurospin
Bât 145, Point Courrier 156
91191 Gif/Yvette, France
tel: +33 1 69 08 79 92
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100915/6e5f2938/attachment.htm>


More information about the vtkusers mailing list