From 740f660ef1feb12b81aa2b5c0eb4fd5229bdcc27 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 5 Oct 2012 16:31:23 +0000 Subject: [PATCH] Made TouchData and osg::Object to aid with serialization. --- include/osgGA/GUIEventAdapter | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/osgGA/GUIEventAdapter b/include/osgGA/GUIEventAdapter index b7ce06a09..e84b5a2b5 100644 --- a/include/osgGA/GUIEventAdapter +++ b/include/osgGA/GUIEventAdapter @@ -329,8 +329,9 @@ public: TOUCH_ENDED }; - class TouchData : public osg::Referenced { + class TouchData : public osg::Object { public: + struct TouchPoint { unsigned int id; TouchPhase phase; @@ -353,7 +354,15 @@ public: typedef TouchSet::iterator iterator; typedef TouchSet::const_iterator const_iterator; - TouchData() : osg::Referenced() {} + TouchData() : osg::Object() {} + + TouchData(const TouchData& td, const osg::CopyOp& copyop): + osg::Object(td,copyop), + _touches(td._touches) {} + + + META_Object(osgGA, TouchData); + unsigned int getNumTouchPoints() const { return _touches.size(); } @@ -367,6 +376,8 @@ public: protected: + virtual ~TouchData() {} + void addTouchPoint(unsigned int id, TouchPhase phase, float x, float y, unsigned int tap_count) { _touches.push_back(TouchPoint(id, phase, x, y, tap_count)); }