mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-11-29 18:59:14 +08:00
add gesturepoint serialize support
This commit is contained in:
parent
4dd7cd50b6
commit
dbe9ae8d71
@ -186,9 +186,9 @@ void Gesture::serialize(std::ostream& out){
|
||||
const int count = strokes.size();
|
||||
|
||||
// Write gesture ID
|
||||
//out.writeLong(mGestureID);
|
||||
GestureIOHelper::writeLong(out,mGestureID);
|
||||
// Write number of strokes
|
||||
//out.writeInt(count);
|
||||
GestureIOHelper::writeInt(out,count);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
strokes.at(i)->serialize(out);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#ifndef __GESTURE_POINT_H__
|
||||
#define __GESTURE_POINT_H__
|
||||
#include <gesture/gesturestore.h>
|
||||
namespace cdroid{
|
||||
class GesturePoint {
|
||||
public:
|
||||
@ -14,10 +15,10 @@ public:
|
||||
}
|
||||
static GesturePoint deserialize(std::istream& in) {
|
||||
// Read X and Y
|
||||
const float x =1;// in.readFloat();
|
||||
const float y =1;// in.readFloat();
|
||||
const float x = GestureIOHelper::readFloat(in);
|
||||
const float y = GestureIOHelper::readFloat(in);
|
||||
// Read timestamp
|
||||
const long timeStamp =1;// in.readLong();
|
||||
const long timeStamp = GestureIOHelper::readLong(in);
|
||||
return GesturePoint{x, y, timeStamp};
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user