From 5f136bccd80d44eaca8928c9307a5dd25b33bf6d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 14 Mar 2016 14:28:55 +0100 Subject: QTouchEvent: add uniqueId and rotation; TUIO: support fiducial tokens TUIO supports tracking tagged physical objects on touchscreens by various means (QR codes, RFIDs etc.) It can detect both position and rotation. Likewise, it may be possible for some touchscreens or drivers to detect orientation of the fingers. So, just as QTabletEvent has rotation, each touchpoint needs to include the rotation value. When using tokens, each object has a permanent unique ID, whereas QTouchEvent::TouchPoint::id() is a transient ID which usually auto- increments each time a finger is pressed to the device. So we need to make that available too, to identify each token. Different platforms may use different kinds of IDs (int, UUID, QR code etc.); however for TUIO 1.x, the unique IDs are just 32-bit integers. QPointerUniqueId is added, storing only a qint64 for now (like QTabletEvent::uniqueId()) but able to be expanded as necessary later on. Task-number: QTBUG-51844 Change-Id: I04182042f47fa2954728079139a4664a31184b54 Reviewed-by: Robin Burchell --- src/plugins/generic/tuiotouch/qtuiohandler_p.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/plugins/generic/tuiotouch/qtuiohandler_p.h') diff --git a/src/plugins/generic/tuiotouch/qtuiohandler_p.h b/src/plugins/generic/tuiotouch/qtuiohandler_p.h index 3034872aae..2e444f2a0d 100644 --- a/src/plugins/generic/tuiotouch/qtuiohandler_p.h +++ b/src/plugins/generic/tuiotouch/qtuiohandler_p.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE class QTouchDevice; class QOscMessage; class QTuioCursor; +class QTuioToken; class QTuioHandler : public QObject { @@ -69,14 +70,21 @@ private slots: void process2DCurAlive(const QOscMessage &message); void process2DCurSet(const QOscMessage &message); void process2DCurFseq(const QOscMessage &message); + void process2DObjSource(const QOscMessage &message); + void process2DObjAlive(const QOscMessage &message); + void process2DObjSet(const QOscMessage &message); + void process2DObjFseq(const QOscMessage &message); private: QWindowSystemInterface::TouchPoint cursorToTouchPoint(const QTuioCursor &tc, QWindow *win); + QWindowSystemInterface::TouchPoint tokenToTouchPoint(const QTuioToken &tc, QWindow *win); QTouchDevice *m_device; QUdpSocket m_socket; QMap m_activeCursors; QVector m_deadCursors; + QMap m_activeTokens; + QVector m_deadTokens; QTransform m_transform; }; -- cgit v1.2.3