[OpendTect_Developers] Start utilizing the TabletInfo class in OpendTect
Jaap Glas
Jaap.Glas at dgbes.com
Fri Nov 19 17:40:14 CET 2010
Dear fellow programmers,
The use of tablet displays is becoming more and more popular world wide.
The upcoming stable OpendTect release 4.2 offers comprehensive user support
for tablet pens. Many object editors in OpendTect have been extended with
extra drawing functionality. This holds for 2D and 3D Horizons, Faults and
FaultStickSets, and Bodies, in both 2D viewers and 3D scenes. The editors
for drawing Prestack events, Gather mutes, and Velocity functions in the
uiVMB plugin have been upgraded as well.
Where the user was previously drawing things by performing a sequence of
seed clicks with the mouse, now whole curves can be drawn at once by moving
the tablet pen over the display. Mouse users can enjoy this functionality
as well by dragging the mouse pointer over their screen. However, some of
the new features are for tablet users exclusively. For example, they will
be able to erase seeds points with the backside of their tablet pen.
I think every developer should ask him/herself what the availability of a
tablet can add to the features in his/her own OpendTect plugin or part of
the OpendTect base code. You can either pass suggestions to me, or start
upgrading your code yourself. It is not that difficult. It is important
to know that Qt will send tablet events, but in case no event handler is
handling them, the events will be resend as mouse events. I made OpendTect
steal and store all relevant information from the tablet event without
handling it. So everyone else should not try to catch any tablet events
at all, but stick to handling mouse events as before. At any appropriate
place in the code where currently mouse events are processed, one can now
check whether a so-called TabletInfo is available, and add alternative
functionality based on the contents of this TabletInfo.
The TabletInfo class is located in include/General/mouseevent.h. It
provides a static function currentState() returning a TabletInfo pointer
in case the mouse event was originally generated by a tablet pen. A copy
of the TabletInfo can also be retrieved from the MouseEvent class, or
(at 3D scenes) from the EventInfo class (include/visBase/visevent.h).
The extra parameters provided by a TabletInfo include tablet device and
pen pointer type, and the rotation, tilt and exercised pressure of the
tablet pen. For example, I applied the pen pressure in implementing a
rubber-band polygon selection (the red lasso) for 3D scenes. The harder
one presses, the more the polygon expands (src/SoOD/SoPolygonSelect.cc).
I challenge you to suggest or implement many more ideas for tablet
functionalities that might improve the workflow of our OpendTect
users (if they buy a tablet display of course).
Best regards,
Jaap Glas
--
-- dr. Jaap C. Glas
-- Software Engineer
-- dGB Earth Sciences
-- Nijverheidstraat 11-2
-- 7511 JM Enschede, The Netherlands
-- jaap.glas at dgbes.com
-- http://www.dgbes.com
-- Tel: +31 534315155, Fax: +31 534315104
More information about the Developers
mailing list