I forward this mail to the VTK developers, as you may be interested as well.<br><br>Pierre.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Pierre Fillard</b> <span dir="ltr"><<a href="mailto:pierre.fillard@gmail.com">pierre.fillard@gmail.com</a>></span><br>
Date: Wed, Sep 15, 2010 at 11:06 AM<br>Subject: Handling multi-touch gestures in VTK<br>To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br><br><br>Hello,<div><br></div><div><br></div><div>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.</div>
<div><br></div><div><br></div><div>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:</div>
<div>- PinchGestureEvent</div><div>- RotateGestureEvent</div><div>- SwipeGestureEvent</div><div><br></div><div><br></div><div>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.</div>
<div><br></div><div>Moreover, Qt 4.6 proposes gesture events (QGestureEvents) that I properly interfaced in the QVTKWidget class.</div><div><br></div><div><br></div><div>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.</div>
<div><br></div><div><br></div><div>If anyone is interested, I would be happy to share the code, or even give it to kitware for review / integration.</div><div><br></div><div><br></div><div>Anyone can access it anonymously here. These are just files which should be replaced in your VTK source tree:</div>
<div><br></div>svn checkout svn://<a href="http://scm.gforge.inria.fr/svn/parietal-public/Utilities/VTKMultiTouch" target="_blank">scm.gforge.inria.fr/svn/parietal-public/Utilities/VTKMultiTouch</a><div><br></div><div><br>
</div><div>Note that modifications are based on VTK 5.6 and Qt 4.6. And you need a multi-touch device, of course.<br>
<div><br></div><div><br></div><div>Cheers,</div><div>Pierre.<br><br></div><div>-- <br>Pierre Fillard, Ph.D.,<br>Research Scientist<br>INRIA Parietal - Neurospin<br>Bât 145, Point Courrier 156<br>91191 Gif/Yvette, France<br>
tel: +33 1 69 08 79 92<br>
</div></div>
</div><br><br clear="all"><br>-- <br>Pierre Fillard, Ph.D.,<br>Research Scientist<br>INRIA Parietal - Neurospin<br>Bât 145, Point Courrier 156<br>91191 Gif/Yvette, France<br>tel: +33 1 69 08 79 92<br>