Exemple #1
0
        protected void TouchAdded(Tuio2DCursor cur)
        {
            this.current.Add(cur.SessionID, cur);
            Touch t = buildTouch(cur);

            this.TouchAdded(t);
        }
Exemple #2
0
        protected void TouchUpdated(Tuio2DCursor cur)
        {
            this.current[cur.SessionID] = cur;
            Touch t = buildTouch(cur);

            this.TouchUpdated(t.TouchId, t.TouchPoint, t.Properties);
        }
Exemple #3
0
 void updateSetCursors(Dictionary <int, Tuio2DCursor> sets, List <int> alive)
 {
     foreach (int curid in alive)
     {
         //Held cursor
         if (!sets.ContainsKey(curid) && this.current.ContainsKey(curid))
         {
             this.TouchHeld(curid);
         }
         else
         {
             if (sets.ContainsKey(curid) && this.current.ContainsKey(curid))
             {
                 Tuio2DCursor cur = sets[curid];
                 if (cur.IsEqual(this.current[curid]))
                 {
                     //Call touchheld if same value
                     this.TouchHeld(curid);
                 }
                 else
                 {
                     this.TouchUpdated(cur);
                 }
             }
         }
     }
 }
 public bool IsEqual(Tuio2DCursor cursor)
 {
     return(this.Acceleration == cursor.Acceleration &&
            this.PositionX == cursor.PositionX &&
            this.PositionY == cursor.PositionY &&
            this.SessionID == cursor.SessionID &&
            this.VelocityX == cursor.VelocityX &&
            this.VelocityY == cursor.VelocityY);
 }
        public static Dictionary<int, Tuio2DCursor> GetCursors(OSCBundle pack)
        {
            Dictionary<int, Tuio2DCursor> result = new Dictionary<int, Tuio2DCursor>();

            List<OSCMessage> cursors = FindByCommand(pack, "/tuio/2Dcur", "set");
            foreach (OSCMessage msg in cursors)
            {
                Tuio2DCursor cur = new Tuio2DCursor(msg);
                result.Add(cur.SessionID, cur);
            }
            return result;
        }
Exemple #6
0
        Touch buildTouch(Tuio2DCursor cursor)
        {
            TouchProperties prop;

            prop.Acceleration = cursor.Acceleration;
            prop.VelocityX    = cursor.VelocityX;
            prop.VelocityY    = cursor.VelocityY;

            PointF p = getTouchPoint(cursor);


            Touch t = new Touch(cursor.SessionID, p);

            t.Properties = prop;

            return(t);
        }
Exemple #7
0
        PointF getTouchPoint(Tuio2DCursor data)
        {
            float x1 = getScreenPoint((float)data.PositionX,
                                      this.config.Projection.ScaleX,
                                      this.config.Projection.OffsetX,
                                      this.config.Alignment.FlipX,
                                      this.config.CorrectProjection,
                                      ScreenWidth);
            float y1 = getScreenPoint((float)data.PositionY,
                                      this.config.Projection.ScaleY,
                                      this.config.Projection.OffsetY,
                                      this.config.Alignment.FlipY,
                                      this.config.CorrectProjection,
                                      ScreenHeight);

            PointF t = new PointF(x1, y1);

            return(t);
        }
        PointF getTouchPoint(Tuio2DCursor data)
        {
            float x1 = getScreenPoint((float)data.PositionX,
                this.config.Projection.ScaleX,
                this.config.Projection.OffsetX,
                this.config.Alignment.FlipX,
                this.config.CorrectProjection,
                ScreenWidth);
            float y1 = getScreenPoint((float)data.PositionY,
                this.config.Projection.ScaleY,
                this.config.Projection.OffsetY,
                this.config.Alignment.FlipY,
                this.config.CorrectProjection,
                ScreenHeight);

            PointF t = new PointF(x1, y1);
            return t;
        }
        Touch buildTouch(Tuio2DCursor cursor)
        {
            TouchProperties prop;
            prop.Acceleration = cursor.Acceleration;
            prop.VelocityX = cursor.VelocityX;
            prop.VelocityY = cursor.VelocityY;

            PointF p = getTouchPoint(cursor);


            Touch t = new Touch(cursor.SessionID, p);
            t.Properties = prop;

            return t;
        }
 protected void TouchAdded(Tuio2DCursor cur)
 {
     this.current.Add(cur.SessionID, cur);
     Touch t = buildTouch(cur);
     this.TouchAdded(t);
 }
 protected void TouchUpdated(Tuio2DCursor cur)
 {
     this.current[cur.SessionID] = cur;
     Touch t = buildTouch(cur);
     this.TouchUpdated(t.TouchId, t.TouchPoint, t.Properties);
 }
 public bool IsEqual(Tuio2DCursor cursor)
 {
     return this.Acceleration == cursor.Acceleration
         && this.PositionX == cursor.PositionX
         && this.PositionY == cursor.PositionY
         && this.SessionID == cursor.SessionID
         && this.VelocityX == cursor.VelocityX
         && this.VelocityY == cursor.VelocityY;
 }