From 87df69f4c96888fe9a2f5273f2bad900d07a5a0f Mon Sep 17 00:00:00 2001 From: nickos64252 Date: Thu, 3 Nov 2022 17:23:23 +0100 Subject: [PATCH 1/2] Added 25D and 3D --- .gitignore | 3 +- TUIO/TuioBlob.cs | 40 +- TUIO/TuioBlob25D.cs | 459 ++++++++++ TUIO/TuioBlob3D.cs | 719 +++++++++++++++ TUIO/TuioClient.cs | 1627 +++++++++++++++++++++++++++++++--- TUIO/TuioContainer.cs | 104 ++- TUIO/TuioCursor.cs | 86 +- TUIO/TuioCursor25D.cs | 113 +++ TUIO/TuioCursor3D.cs | 113 +++ TUIO/TuioListener.cs | 166 +++- TUIO/TuioObject.cs | 16 +- TUIO/TuioObject25D.cs | 343 ++++++++ TUIO/TuioObject3D.cs | 558 ++++++++++++ TUIO/TuioPoint.cs | 285 +++++- TUIO_DEMO.csproj | 9 +- TUIO_DUMP.csproj | 6 + TUIO_LIB.csproj | 6 + TuioDemo.cs | 371 +++++++- TuioDump.cs | 132 ++- doc/TUIO_CSHARP.xml | 1944 ++++++++++++++++++++++++++++++++++------- 20 files changed, 6569 insertions(+), 531 deletions(-) create mode 100644 TUIO/TuioBlob25D.cs create mode 100644 TUIO/TuioBlob3D.cs create mode 100644 TUIO/TuioCursor25D.cs create mode 100644 TUIO/TuioCursor3D.cs create mode 100644 TUIO/TuioObject25D.cs create mode 100644 TUIO/TuioObject3D.cs diff --git a/.gitignore b/.gitignore index df1fb9c..526edda 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ *.pdb bin/ obj/ +.vs/ Help/ TestResults/ *.userprefs @@ -42,4 +43,4 @@ TestResults/ .DS_Store* ehthumbs.db Icon? -Thumbs.db \ No newline at end of file +Thumbs.db diff --git a/TUIO/TuioBlob.cs b/TUIO/TuioBlob.cs index 18acbca..b9c29f8 100644 --- a/TUIO/TuioBlob.cs +++ b/TUIO/TuioBlob.cs @@ -81,7 +81,12 @@ public class TuioBlob : TuioContainer * * Defines the ROTATING state. */ - public static readonly int TUIO_ROTATING = 5; + public static readonly int TUIO_ROTATING = 4; + /** + * + * Defines the RESIZED state. + */ + public static readonly int TUIO_RESIZED = 7; #endregion #region Constructors @@ -101,8 +106,8 @@ public class TuioBlob : TuioContainer * the height to assign * the area to assign */ - public TuioBlob(TuioTime ttime, long si, int bi, float xp, float yp, float a, float w, float h, float f) - : base(ttime, si, xp, yp) + public TuioBlob(TuioTime ttime, long si, int bi, float xp, float yp, float a, float w, float h, float f) + : base(ttime, si, xp, yp, 0) { blob_id = bi; angle = a; @@ -128,7 +133,7 @@ public TuioBlob(TuioTime ttime, long si, int bi, float xp, float yp, float a, fl * the area to assign */ public TuioBlob(long si, int bi, float xp, float yp, float a, float w, float h, float f) - : base(si, xp, yp) + : base(si, xp, yp, 0) { blob_id = bi; angle = a; @@ -182,14 +187,17 @@ public TuioBlob(TuioBlob tblb) */ public void update(TuioTime ttime, float xp, float yp, float a, float w, float h, float f, float xs, float ys, float rs, float ma, float ra) { - base.update(ttime, xp, yp, xs, ys, ma); + base.update(ttime, xp, yp, 0, xs, ys, 0, ma); angle = a; - width = w; + float dw = width - w; + float dh = height - h; + width = w; height = h; area = f; rotation_speed = rs; rotation_accel = ra; if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0) state = TUIO_RESIZED; } /** @@ -212,14 +220,17 @@ public void update(TuioTime ttime, float xp, float yp, float a, float w, float h */ public void update(float xp, float yp, float a, float w, float h, float f, float xs, float ys, float rs, float ma, float ra) { - base.update(xp, yp, xs, ys, ma); + base.update(xp, yp, 0, xs, ys, 0, ma); angle = a; - width = w; + float dw = width - w; + float dh = height - h; + width = w; height = h; area = f; rotation_speed = rs; rotation_accel = ra; if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0) state = TUIO_RESIZED; } /** @@ -239,9 +250,11 @@ public void update(float xp, float yp, float a, float w, float h, float f, float public void update(TuioTime ttime, float xp, float yp, float a,float w, float h, float f) { TuioPoint lastPoint = path.Last.Value; - base.update(ttime, xp, yp); + base.update(ttime, xp, yp, 0); - width = w; + float dw = width - w; + float dh = height - h; + width = w; height = h; area = f; @@ -254,10 +267,11 @@ public void update(TuioTime ttime, float xp, float yp, float a,float w, float h, float da = (angle - last_angle) / (2.0f * (float)Math.PI); if (da > 0.75f) da -= 1.0f; else if (da < -0.75f) da += 1.0f; - + angle = a; rotation_speed = da / dt; rotation_accel = (rotation_speed - last_rotation_speed) / dt; if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0) state = TUIO_RESIZED; } /** @@ -277,7 +291,7 @@ public void update(TuioBlob tblb) area = tblb.Area; rotation_speed = tblb.RotationSpeed; rotation_accel = tblb.RotationAccel; - if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + state = tblb.state; } /** @@ -287,7 +301,7 @@ public void update(TuioBlob tblb) */ public new void stop(TuioTime ttime) { - update(ttime, this.xpos, this.ypos, this.angle, this.width, this.height, this.area); + update(ttime, this.xpos, this.ypos, this.angle, this.width, this.height, this.area); } #endregion diff --git a/TUIO/TuioBlob25D.cs b/TUIO/TuioBlob25D.cs new file mode 100644 index 0000000..794f1a5 --- /dev/null +++ b/TUIO/TuioBlob25D.cs @@ -0,0 +1,459 @@ +/* + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2005-2016 Martin Kaltenbrunner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. +*/ + +using System; +using System.Collections.Generic; + +namespace TUIO +{ + + /** + * + * The TuioBlob25D class encapsulates /tuio/25Dblb TUIO objects. + * + * + * @author Nicolas Bremard + * @version 1.1.7 + */ + public class TuioBlob25D : TuioContainer + { + /** + * + * The individual symbol ID number that is assigned to each TuioBlob25D. + */ + protected int blob_id; + + /** + * + * The rotation angle value. + */ + protected float angle; + + /** + * + * The blob width value. + */ + protected float width; + + /** + * + * The blob height value. + */ + protected float height; + + /** + * + * The blob area value. + */ + protected float area; + + + /** + * + * The rotation speed value. + */ + protected float rotation_speed; + + /** + * + * The rotation acceleration value. + */ + protected float rotation_accel; + + #region State Enumeration Values + + /** + * + * Defines the ROTATING state. + */ + public static readonly int TUIO_ROTATING = 4; + /** + * + * Defines the RESIZED state. + */ + public static readonly int TUIO_RESIZED = 7; + #endregion + + #region Constructors + + /** + * + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioBlob25D. + * + * the TuioTime to assign + * the Session ID to assign + * the Blob ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle to assign + * the width to assign + * the height to assign + * the area to assign + */ + public TuioBlob25D(TuioTime ttime, long si, int bi, float xp, float yp, float zp, float a, float w, float h, float f) + : base(ttime, si, xp, yp, zp) + { + blob_id = bi; + angle = a; + width = w; + height = h; + area = f; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * + * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + * and angle, and assigs these values to the newly created TuioBlob25D. + * + * the Session ID to assign + * the Blob ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle to assign + * the width to assign + * the height to assign + * the area to assign + */ + public TuioBlob25D(long si, int bi, float xp, float yp, float zp, float a, float w, float h, float f) + : base(si, xp, yp, zp) + { + blob_id = bi; + angle = a; + width = w; + height = h; + area = f; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * + * This constructor takes the atttibutes of the provided TuioBlob25D + * and assigs these values to the newly created TuioBlob25D. + * + * the TuioBlob25D to assign + */ + public TuioBlob25D(TuioBlob25D tblb) + : base(tblb) + { + blob_id = tblb.BlobID; + angle = tblb.Angle; + width = tblb.Width; + height = tblb.Height; + area = tblb.Area; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + #endregion + + #region Update Methods + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioBlob25D attributes. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + * the width to assign + * the height to assign + * the area to assign + * the X velocity to assign + * the Y velocity to assign + * the rotation velocity to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float a, float w, float h, float f, float xs, float ys, float zs, float rs, float ma, float ra) + { + base.update(ttime, xp, yp, zp, xs, ys, zs, ma); + angle = a; + float dw = width - w; + float dh = height - h; + width = w; + height = h; + area = f; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0) state = TUIO_RESIZED; + } + + /** + * + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + * the width to assign + * the height to assign + * the area to assign + * the X velocity to assign + * the Y velocity to assign + * the rotation velocity to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(float xp, float yp, float zp, float a, float w, float h, float f, float xs, float ys, float zs, float rs, float ma, float ra) + { + base.update(xp, yp, zp, xs, ys, zs, ma); + angle = a; + float dw = width - w; + float dh = height - h; + width = w; + height = h; + area = f; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0) state = TUIO_RESIZED; + } + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioBlob25D attributes. + * The speed and accleration values are calculated accordingly. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + * the width to assign + * the height to assign + * the area to assign + */ + public new void update(TuioTime ttime, float xp, float yp, float zp, float a,float w, float h, float f) + { + TuioPoint lastPoint = path.Last.Value; + base.update(ttime, xp, yp, zp); + + float dw = width - w; + float dh = height - h; + width = w; + height = h; + area = f; + + TuioTime diffTime = currentTime - lastPoint.TuioTime; + float dt = diffTime.TotalMilliseconds / 1000.0f; + float last_angle = angle; + float last_rotation_speed = rotation_speed; + angle = a; + + float da = (angle - last_angle) / (2.0f * (float)Math.PI); + if (da > 0.75f) da -= 1.0f; + else if (da < -0.75f) da += 1.0f; + angle = a; + rotation_speed = da / dt; + rotation_accel = (rotation_speed - last_rotation_speed) / dt; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0 ) state = TUIO_RESIZED; + } + + /** + * + * Takes the atttibutes of the provided TuioBlob25D + * and assigs these values to this TuioBlob25D. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * the TuioContainer to assign + */ + public void update(TuioBlob25D tblb) + { + base.update(tblb); + angle = tblb.Angle; + width = tblb.Width; + height = tblb.Height; + area = tblb.Area; + rotation_speed = tblb.RotationSpeed; + rotation_accel = tblb.RotationAccel; + state = tblb.state; + } + + /** + * + * This method is used to calculate the speed and acceleration values of a + * TuioBlob25D with unchanged position and angle. + */ + public new void stop(TuioTime ttime) + { + update(ttime, this.xpos, this.ypos, this.zpos, this.angle, this.width, this.height, this.area); + } + #endregion + + #region Properties & Getter/Setter Methods + + /** + * + * Returns the symbol ID of this TuioBlob25D. + * the symbol ID of this TuioBlob25D + */ + public int BlobID + { + get { return blob_id; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public int getBlobID() + { + return BlobID; + } + + /** + * + * Returns the width of this TuioBlob25D. + * the width of this TuioBlob25D + */ + public float Width + { + get { return width; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getWidth() + { + return Width; + } + + /** + * + * Returns the height of this TuioBlob25D. + * the heigth of this TuioBlob25D + */ + public float Height + { + get { return height; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getHeight() + { + return Height; + } + + /** + * + * Returns the area of this TuioBlob25D. + * the area of this TuioBlob25D + */ + public float Area + { + get { return area; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getArea() + { + return Area; + } + + /** + * + * Returns the rotation angle of this TuioBlob25D. + * the rotation angle of this TuioBlob25D + */ + public float Angle + { + get { return angle; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getAngle() + { + return Angle; + } + + /** + * + * Returns the rotation angle in degrees of this TuioBlob25D. + * the rotation angle in degrees of this TuioBlob25D + */ + public float AngleDegrees + { + get { return angle / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getAngleDegrees() + { + return AngleDegrees; + } + + /** + * + * Returns the rotation speed of this TuioBlob25D. + * the rotation speed of this TuioBlob25D + */ + public float RotationSpeed + { + get { return rotation_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRotationSpeed() + { + return RotationSpeed; + } + + /** + * + * Returns the rotation acceleration of this TuioBlob25D. + * the rotation acceleration of this TuioBlob25D + */ + public float RotationAccel + { + get { return rotation_accel; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRotationAccel() + { + return RotationAccel; + } + + /** + * + * Returns true of this TuioBlob25D is moving. + * true of this TuioBlob25D is moving + */ + public override bool isMoving + { + get + { + if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING) || (state == TUIO_ROTATING) || (state == TUIO_RESIZED)) return true; + else return false; + } + } + #endregion + } + +} diff --git a/TUIO/TuioBlob3D.cs b/TUIO/TuioBlob3D.cs new file mode 100644 index 0000000..f97b1fd --- /dev/null +++ b/TUIO/TuioBlob3D.cs @@ -0,0 +1,719 @@ +/* + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2005-2016 Martin Kaltenbrunner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. +*/ + +using System; +using System.Collections.Generic; + +namespace TUIO +{ + + /** + * + * The TuioBlob3D class encapsulates /tuio/3Dblb TUIO objects. + * + * + * @author Nicolas Bremard + * @version 1.1.7 + */ + public class TuioBlob3D : TuioContainer + { + /** + * + * The individual symbol ID number that is assigned to each TuioBlob3D. + */ + protected int blob_id; + + /** + * The roll angle value. + */ + float roll; + /** + * The roll speed value. + */ + float roll_speed; + /** + * The pitch angle value. + */ + float pitch; + /** + * The pitch speed value. + */ + float pitch_speed; + + /** + * The yaw angle value. + */ + float yaw; + /** + * The yaw speed value. + */ + float yaw_speed; + /** + * + * The blob width value. + */ + protected float width; + + /** + * + * The blob height value. + */ + protected float height; + + /** + * + * The blob height value. + */ + protected float depth; + + + /** + * + * The blob volume value. + */ + protected float volume; + + + + /** + * + * The rotation acceleration value. + */ + protected float rotation_accel; + + #region State Enumeration Values + + /** + * + * Defines the ROTATING state. + */ + public static readonly int TUIO_ROTATING = 4; + /** + * + * Defines the RESIZED state. + */ + public static readonly int TUIO_RESIZED = 7; + #endregion + + #region Constructors + + /** + * + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioBlob3D. + * + * the TuioTime to assign + * the Session ID to assign + * the Blob ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the width to assign + * the height to assign + * the depth to assign + * the volume to assign + */ + public TuioBlob3D(TuioTime ttime, long si, int bi, float xp, float yp, float zp, float ro, float po, float yo, float w, float h, float d, float v) + : base(ttime, si, xp, yp, zp) + { + blob_id = bi; + + roll = ro; + pitch = po; + yaw = yo; + roll_speed = 0.0f; + pitch_speed = 0.0f; + yaw_speed = 0.0f; + + rotation_accel = 0.0f; + + width = w; + height = h; + depth = d; + volume = v; + } + + /** + * + * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + * and angle, and assigs these values to the newly created TuioBlob3D. + * + * the Session ID to assign + * the Blob ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the width to assign + * the height to assign + * the depth to assign + * the volume to assign + */ + public TuioBlob3D(long si, int bi, float xp, float yp, float zp, float ro, float po, float yo, float w, float h, float d, float v) + : base(si, xp, yp, zp) + { + blob_id = bi; + roll = ro; + pitch = po; + yaw = yo; + roll_speed = 0.0f; + pitch_speed = 0.0f; + yaw_speed = 0.0f; + + rotation_accel = 0.0f; + + width = w; + height = h; + depth = d; + volume = v; + } + + /** + * + * This constructor takes the atttibutes of the provided TuioBlob3D + * and assigs these values to the newly created TuioBlob3D. + * + * the TuioBlob3D to assign + */ + public TuioBlob3D(TuioBlob3D tblb) + : base(tblb) + { + blob_id = tblb.BlobID; + roll = tblb.Roll; + pitch = tblb.Pitch; + yaw = tblb.Yaw; + width = tblb.Width; + height = tblb.Height; + depth = tblb.Depth; + volume = tblb.Volume; + roll_speed = tblb.RollSpeed; + pitch_speed = tblb.PitchSpeed; + yaw_speed = tblb.YawSpeed; + rotation_accel = tblb.RotationAccel; + } + #endregion + + #region Update Methods + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioBlob3D attributes. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the width to assign + * the height to assign + * the depth to assign + * the volume to assign + * the X velocity to assign + * the Y velocity to assign + * the Y velocity to assign + * the roll speed to assign + * the pitch speed to assign + * the yaw speed to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float ro, float po, float yo, float w, float h, float d, float v, float xs, float ys, float zs, float ros, float pos, float yos, float ma, float ra) + { + base.update(ttime, xp, yp, zp, xs, ys, zs, ma); + roll = ro; + pitch = po; + yaw = yo; + roll_speed = ros; + yaw_speed = pos; + pitch_speed = yos; + + float dw = width - w; + float dh = height - h; + float dd = depth - d; + width = w; + height = h; + depth = d; + volume = v; + + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0 || dd != 0) state = TUIO_RESIZED; + } + + /** + * + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the width to assign + * the height to assign + * the depth to assign + * the volume to assign + * the X velocity to assign + * the Y velocity to assign + * the Y velocity to assign + * the roll speed to assign + * the pitch speed to assign + * the yaw speed to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(float xp, float yp, float zp, float ro, float po, float yo, float w, float h, float d, float v, float xs, float ys, float zs, float ros, float pos, float yos, float ma, float ra) + { + base.update(xp, yp, zp, xs, ys, zs, ma); + roll = ro; + pitch = po; + yaw = yo; + roll_speed = ros; + yaw_speed = pos; + pitch_speed = yos; + + float dw = width - w; + float dh = height - h; + float dd = depth - d; + width = w; + height = h; + depth = d; + volume = v; + + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0 || dd != 0) state = TUIO_RESIZED; + } + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioBlob3D attributes. + * The speed and accleration values are calculated accordingly. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the width to assign + * the height to assign + * the depth to assign + * the volume to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float ro, float po, float yo, float w, float h, float d, float v) + { + TuioPoint lastPoint = path.Last.Value; + base.update(ttime, xp, yp, zp); + + float dw = width - w; + float dh = height - h; + float dd = depth - d; + width = w; + height = h; + depth = d; + volume = v; + + TuioTime diffTime = currentTime - lastPoint.TuioTime; + float dt = diffTime.TotalMilliseconds / 1000.0f; + + + float last_roll = roll; + roll = ro; + + float dro = (roll - last_roll) / (2.0f * (float)Math.PI); + if (dro > 0.75f) dro -= 1.0f; + else if (dro < -0.75f) dro += 1.0f; + + float last_roll_speed = roll_speed; + roll_speed = dro / dt; + float roll_accel = (yaw_speed - last_roll_speed) / dt; + + + float last_pitch = pitch; + pitch = po; + + float dpo = (pitch - last_pitch) / (2.0f * (float)Math.PI); + if (dpo > 0.75f) dpo -= 1.0f; + else if (dpo < -0.75f) dpo += 1.0f; + + float last_pitch_speed = pitch_speed; + pitch_speed = dpo / dt; + float pitch_accel = (pitch_speed - last_pitch_speed) / dt; + + + float last_yaw = yaw; + yaw = yo; + + float dyo = (yaw - last_yaw) / (2.0f * (float)Math.PI); + if (dyo > 0.75f) dyo -= 1.0f; + else if (dyo < -0.75f) dyo += 1.0f; + + float last_yaw_speed = yaw_speed; + yaw_speed = dyo / dt; + float yaw_accel = (yaw_speed - last_yaw_speed) / dt; + + + rotation_accel = (roll_accel + pitch_accel + yaw_accel) / 3; + + + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + if (dw != 0 || dh != 0 || dd != 0) state = TUIO_RESIZED; + } + + /** + * + * Takes the atttibutes of the provided TuioBlob3D + * and assigs these values to this TuioBlob3D. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * the TuioContainer to assign + */ + public void update(TuioBlob3D tblb) + { + base.update(tblb); + + state = tblb.state; + + roll = tblb.Roll; + pitch = tblb.Pitch; + yaw = tblb.Yaw; + width = tblb.Width; + height = tblb.Height; + depth = tblb.Depth; + volume = tblb.Volume; + roll_speed = tblb.RollSpeed; + pitch_speed = tblb.PitchSpeed; + yaw_speed = tblb.YawSpeed; + rotation_accel = tblb.RotationAccel; + } + + /** + * + * This method is used to calculate the speed and acceleration values of a + * TuioBlob3D with unchanged position and angle. + */ + public new void stop(TuioTime ttime) + { + update(ttime, this.xpos, this.ypos, this.zpos, this.roll, this.pitch, this.yaw, this.width, this.height, this.depth, this.volume); + } + #endregion + + #region Properties & Getter/Setter Methods + + /** + * + * Returns the symbol ID of this TuioBlob3D. + * the symbol ID of this TuioBlob3D + */ + public int BlobID + { + get { return blob_id; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public int getBlobID() + { + return BlobID; + } + + /** + * + * Returns the width of this TuioBlob3D. + * the width of this TuioBlob3D + */ + public float Width + { + get { return width; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getWidth() + { + return Width; + } + + /** + * + * Returns the height of this TuioBlob3D. + * the heigth of this TuioBlob3D + */ + public float Height + { + get { return height; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getHeight() + { + return Height; + } + + /** + * + * Returns the depth of this TuioBlob3D. + * the depth of this TuioBlob3D + */ + public float Depth + { + get { return depth; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getDepth() + { + return Depth; + } + + /** + * + * Returns the volume of this TuioBlob3D. + * the volume of this TuioBlob3D + */ + public float Volume + { + get { return volume; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getVolume() + { + return Volume; + } + + + + + + + /** + * + * Returns the rotation roll of this TuioBlob3D. + * the rotation roll of this TuioBlob3D + */ + public float Roll + { + get { return roll; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRoll() + { + return Roll; + } + + /** + * + * Returns the rotation roll in degrees of this TuioBlob3D. + * the rotation roll in degrees of this TuioBlob3D + */ + public float RollDegrees + { + get { return roll / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRollDegrees() + { + return RollDegrees; + } + + + + + + /** + * + * Returns the rotation pitch of this TuioBlob3D. + * the rotation pitch of this TuioBlob3D + */ + public float Pitch + { + get { return pitch; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getPitch() + { + return Pitch; + } + + /** + * + * Returns the rotation pitch in degrees of this TuioBlob3D. + * the rotation pitch in degrees of this TuioBlob3D + */ + public float PitchDegrees + { + get { return pitch / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getPitchDegrees() + { + return PitchDegrees; + } + + + + + + + + /** + * + * Returns the rotation yaw of this TuioBlob3D. + * the rotation yaw of this TuioBlob3D + */ + public float Yaw + { + get { return yaw; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getYaw() + { + return Yaw; + } + + /** + * + * Returns the rotation yaw in degrees of this TuioBlob3D. + * the rotation yaw in degrees of this TuioBlob3D + */ + public float YawDegrees + { + get { return yaw / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getYawDegrees() + { + return YawDegrees; + } + + + + + + + /** + * + * Returns the roll speed of this TuioBlob3D. + * the roll speed of this TuioBlob3D + */ + public float RollSpeed + { + get { return roll_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRollSpeed() + { + return RollSpeed; + } + + + + /** + * + * Returns the pitch speed of this TuioBlob3D. + * the pitch speed of this TuioBlob3D + */ + public float PitchSpeed + { + get { return pitch_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getPitchSpeed() + { + return PitchSpeed; + } + + + + /** + * + * Returns the yaw speed of this TuioBlob3D. + * the yaw speed of this TuioBlob3D + */ + public float YawSpeed + { + get { return yaw_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getYawSpeed() + { + return YawSpeed; + } + + + + + + + + /** + * + * Returns the rotation acceleration of this TuioBlob3D. + * the rotation acceleration of this TuioBlob3D + */ + public float RotationAccel + { + get { return rotation_accel; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRotationAccel() + { + return RotationAccel; + } + + /** + * + * Returns true of this TuioBlob3D is moving. + * true of this TuioBlob3D is moving + */ + public override bool isMoving + { + get + { + if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING) || (state == TUIO_ROTATING) || (state == TUIO_RESIZED)) return true; + else return false; + } + } + #endregion + } + +} diff --git a/TUIO/TuioClient.cs b/TUIO/TuioClient.cs index 40d963f..5a256d0 100644 --- a/TUIO/TuioClient.cs +++ b/TUIO/TuioClient.cs @@ -1,6 +1,6 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -71,6 +71,69 @@ public class TuioClient private List freeBlobList = new List(); private int maxBlobID = -1; + + + //25D + + private object cursor25DSync = new object(); + private object object25DSync = new object(); + private object blob25DSync = new object(); + + private Dictionary object25DList = new Dictionary(32); + private List aliveObject25DList = new List(32); + private List newObject25DList = new List(32); + private Dictionary cursor25DList = new Dictionary(32); + private List aliveCursor25DList = new List(32); + private List newCursor25DList = new List(32); + private Dictionary blob25DList = new Dictionary(32); + private List aliveBlob25DList = new List(32); + private List newBlob25DList = new List(32); + private List frameObjects25D = new List(32); + private List frameCursors25D = new List(32); + private List frameBlobs25D = new List(32); + + private List freeCursor25DList = new List(); + private int maxCursor25DID = -1; + private List freeBlob25DList = new List(); + private int maxBlob25DID = -1; + + + + + + //3D + + private object cursor3DSync = new object(); + private object object3DSync = new object(); + private object blob3DSync = new object(); + + private Dictionary object3DList = new Dictionary(32); + private List aliveObject3DList = new List(32); + private List newObject3DList = new List(32); + private Dictionary cursor3DList = new Dictionary(32); + private List aliveCursor3DList = new List(32); + private List newCursor3DList = new List(32); + private Dictionary blob3DList = new Dictionary(32); + private List aliveBlob3DList = new List(32); + private List newBlob3DList = new List(32); + private List frameObjects3D = new List(32); + private List frameCursors3D = new List(32); + private List frameBlobs3D = new List(32); + + private List freeCursor3DList = new List(); + private int maxCursor3DID = -1; + private List freeBlob3DList = new List(); + private int maxBlob3DID = -1; + + + + + + + + + + private int currentFrame = 0; private TuioTime currentTime; @@ -152,6 +215,31 @@ public void disconnect() frameBlobs.Clear(); freeCursorList.Clear(); freeBlobList.Clear(); + + + aliveObject25DList.Clear(); + aliveCursor25DList.Clear(); + aliveBlob25DList.Clear(); + object25DList.Clear(); + cursor25DList.Clear(); + blob25DList.Clear(); + frameObjects25D.Clear(); + frameCursors25D.Clear(); + frameBlobs25D.Clear(); + freeCursor25DList.Clear(); + freeBlob25DList.Clear(); + + aliveObject3DList.Clear(); + aliveCursor3DList.Clear(); + aliveBlob3DList.Clear(); + object3DList.Clear(); + cursor3DList.Clear(); + blob3DList.Clear(); + frameObjects3D.Clear(); + frameCursors3D.Clear(); + frameBlobs3D.Clear(); + freeCursor3DList.Clear(); + freeBlob3DList.Clear(); } /** @@ -318,7 +406,7 @@ private void processMessage(OSCMessage message) break; default: TuioObject updateObject = getTuioObject(tobj.SessionID); - if ((tobj.X != updateObject.X && tobj.XSpeed == 0) || (tobj.Y != updateObject.Y && tobj.YSpeed == 0)) + if ((tobj.X != updateObject.X && tobj.XSpeed == 0) || (tobj.Y != updateObject.Y && tobj.YSpeed == 0) || (tobj.Angle != updateObject.Angle && tobj.RotationSpeed == 0)) updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Angle); else updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Angle, tobj.XSpeed, tobj.YSpeed, tobj.RotationSpeed, tobj.MotionAccel, tobj.RotationAccel); @@ -735,133 +823,1436 @@ private void processMessage(OSCMessage message) } } - } + else if (address == "/tuio/25Dobj") + { + if (command == "set") + { - #region Listener Management - /** - * - * Adds the provided TuioListener to the list of registered TUIO event listeners - * the TuioListener to add - */ - public void addTuioListener(TuioListener listener) - { - listenerList.Add(listener); - } + long s_id = (int)args[1]; + int f_id = (int)args[2]; + float xpos = (float)args[3]; + float ypos = (float)args[4]; + float zpos = (float)args[5]; + float angle = (float)args[6]; + float xspeed = (float)args[7]; + float yspeed = (float)args[8]; + float zspeed = (float)args[9]; + float rspeed = (float)args[10]; + float maccel = (float)args[11]; + float raccel = (float)args[12]; + + lock (object25DSync) + { + if (!object25DList.ContainsKey(s_id)) + { + TuioObject25D addObject = new TuioObject25D(s_id, f_id, xpos, ypos,zpos, angle); + frameObjects25D.Add(addObject); + } + else + { + TuioObject25D tobj = object25DList[s_id]; + if (tobj == null) return; + if ((tobj.X != xpos) || (tobj.Y != ypos) || (tobj.Z != zpos) || (tobj.Angle != angle) || (tobj.XSpeed != xspeed) || (tobj.YSpeed != yspeed) || (tobj.ZSpeed != zspeed) || (tobj.RotationSpeed != rspeed) || (tobj.MotionAccel != maccel) || (tobj.RotationAccel != raccel)) + { - /** - * - * Removes the provided TuioListener from the list of registered TUIO event listeners - * the TuioListener to remove - */ - public void removeTuioListener(TuioListener listener) - { - listenerList.Remove(listener); - } + TuioObject25D updateObject = new TuioObject25D(s_id, f_id, xpos, ypos,zpos, angle); + updateObject.update(xpos, ypos,zpos, angle, xspeed, yspeed,zspeed, rspeed, maccel, raccel); + frameObjects25D.Add(updateObject); + } + } + } - /** - * - * Removes all TuioListener from the list of registered TUIO event listeners - */ - public void removeAllTuioListeners() - { - listenerList.Clear(); - } - #endregion + } + else if (command == "alive") + { - #region Object Management + newObject25DList.Clear(); + for (int i = 1; i < args.Count; i++) + { + // get the message content + long s_id = (int)args[i]; + newObject25DList.Add(s_id); + // reduce the object list to the lost objects + if (aliveObject25DList.Contains(s_id)) + aliveObject25DList.Remove(s_id); + } - /** - * - * Returns a List of all currently active TuioObjects - * a List of all currently active TuioObjects - */ - public List getTuioObjects() - { - List listBuffer; - lock (objectSync) - { - listBuffer = new List(objectList.Values); - } - return listBuffer; - } + // remove the remaining objects + lock (object25DSync) + { + for (int i = 0; i < aliveObject25DList.Count; i++) + { + long s_id = aliveObject25DList[i]; + TuioObject25D removeObject = object25DList[s_id]; + removeObject.remove(currentTime); + frameObjects25D.Add(removeObject); + } + } - /** - * - * Returns a List of all currently active TuioCursors - * a List of all currently active TuioCursors - */ - public List getTuioCursors() - { - List listBuffer; - lock (cursorSync) - { - listBuffer = new List(cursorList.Values); - } - return listBuffer; - } + } + else if (command == "fseq") + { + int fseq = (int)args[1]; + bool lateFrame = false; - /** - * - * Returns a List of all currently active TuioBlobs - * a List of all currently active TuioBlobs - */ - public List getTuioBlobs() - { - List listBuffer; - lock (blobSync) - { - listBuffer = new List(blobList.Values); - } - return listBuffer; - } + if (fseq > 0) + { + if (fseq > currentFrame) currentTime = TuioTime.SessionTime; + if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; + else lateFrame = true; + } + else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) + { + currentTime = TuioTime.SessionTime; + } - /** - * - * Returns the TuioObject corresponding to the provided Session ID - * or NULL if the Session ID does not refer to an active TuioObject - * an active TuioObject corresponding to the provided Session ID or NULL - */ - public TuioObject getTuioObject(long s_id) - { - TuioObject tobject = null; - lock (objectSync) - { - objectList.TryGetValue(s_id, out tobject); - } - return tobject; - } + if (!lateFrame) + { + + IEnumerator frameEnum = frameObjects25D.GetEnumerator(); + while (frameEnum.MoveNext()) + { + TuioObject25D tobj = frameEnum.Current; + + switch (tobj.TuioState) + { + case TuioObject25D.TUIO_REMOVED: + TuioObject25D removeObject = tobj; + removeObject.remove(currentTime); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.removeTuioObject25D(removeObject); + } + lock (object25DSync) + { + object25DList.Remove(removeObject.SessionID); + } + break; + case TuioObject25D.TUIO_ADDED: + TuioObject25D addObject = new TuioObject25D(currentTime, tobj.SessionID, tobj.SymbolID, tobj.X, tobj.Y, tobj.Z, tobj.Angle); + lock (object25DSync) + { + object25DList.Add(addObject.SessionID, addObject); + } + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.addTuioObject25D(addObject); + } + break; + default: + TuioObject25D updateObject = getTuioObject25D(tobj.SessionID); + if ((tobj.X != updateObject.X && tobj.XSpeed == 0) || (tobj.Y != updateObject.Y && tobj.YSpeed == 0) || (tobj.Z != updateObject.Z && tobj.ZSpeed == 0) || (tobj.Angle != updateObject.Angle && tobj.RotationSpeed == 0)) + updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Z, tobj.Angle); + else + updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Z, tobj.Angle, tobj.XSpeed, tobj.YSpeed, tobj.ZSpeed, tobj.RotationSpeed, tobj.MotionAccel, tobj.RotationAccel); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.updateTuioObject25D(updateObject); + } + break; + } + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.refresh(new TuioTime(currentTime)); + } + + List buffer = aliveObject25DList; + aliveObject25DList = newObject25DList; + // recycling the List + newObject25DList = buffer; + } + frameObjects25D.Clear(); + } - /** - * - * Returns the TuioCursor corresponding to the provided Session ID - * or NULL if the Session ID does not refer to an active TuioCursor - * an active TuioCursor corresponding to the provided Session ID or NULL - */ - public TuioCursor getTuioCursor(long s_id) - { - TuioCursor tcursor = null; - lock (cursorSync) - { - cursorList.TryGetValue(s_id, out tcursor); } - return tcursor; - } + else if (address == "/tuio/25Dcur") + { + + if (command == "set") + { + + long s_id = (int)args[1]; + float xpos = (float)args[2]; + float ypos = (float)args[3]; + float zpos = (float)args[4]; + float xspeed = (float)args[5]; + float yspeed = (float)args[6]; + float zspeed = (float)args[7]; + float maccel = (float)args[8]; + + lock (cursor25DList) + { + if (!cursor25DList.ContainsKey(s_id)) + { + + TuioCursor25D addCursor = new TuioCursor25D(s_id, -1, xpos, ypos,zpos); + frameCursors25D.Add(addCursor); + + } + else + { + TuioCursor25D tcur = (TuioCursor25D)cursor25DList[s_id]; + if (tcur == null) return; + if ((tcur.X != xpos) || (tcur.Y != ypos) || (tcur.Z != zpos) || (tcur.XSpeed != xspeed) || (tcur.YSpeed != yspeed) || (tcur.ZSpeed != zspeed) || (tcur.MotionAccel != maccel)) + { + TuioCursor25D updateCursor = new TuioCursor25D(s_id, tcur.CursorID, xpos, ypos,zpos); + updateCursor.update(xpos, ypos,zpos, xspeed, yspeed,zspeed, maccel); + frameCursors25D.Add(updateCursor); + } + } + } + + } + else if (command == "alive") + { + + newCursor25DList.Clear(); + for (int i = 1; i < args.Count; i++) + { + // get the message content + long s_id = (int)args[i]; + newCursor25DList.Add(s_id); + // reduce the cursor list to the lost cursors + if (aliveCursor25DList.Contains(s_id)) + aliveCursor25DList.Remove(s_id); + } + + // remove the remaining cursors + lock (cursor25DSync) + { + for (int i = 0; i < aliveCursor25DList.Count; i++) + { + long s_id = aliveCursor25DList[i]; + if (!cursor25DList.ContainsKey(s_id)) continue; + TuioCursor25D removeCursor = cursor25DList[s_id]; + removeCursor.remove(currentTime); + frameCursors25D.Add(removeCursor); + } + } + + } + else if (command == "fseq") + { + int fseq = (int)args[1]; + bool lateFrame = false; + + if (fseq > 0) + { + if (fseq > currentFrame) currentTime = TuioTime.SessionTime; + if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; + else lateFrame = true; + } + else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) + { + currentTime = TuioTime.SessionTime; + } + + if (!lateFrame) + { + + IEnumerator frameEnum = frameCursors25D.GetEnumerator(); + while (frameEnum.MoveNext()) + { + TuioCursor25D tcur = frameEnum.Current; + switch (tcur.TuioState) + { + case TuioCursor.TUIO_REMOVED: + TuioCursor25D removeCursor = tcur; + removeCursor.remove(currentTime); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.removeTuioCursor25D(removeCursor); + } + lock (cursor25DSync) + { + cursor25DList.Remove(removeCursor.SessionID); + + if (removeCursor.CursorID == maxCursor25DID) + { + maxCursor25DID = -1; + + if (cursor25DList.Count > 0) + { + + IEnumerator> clist = cursor25DList.GetEnumerator(); + while (clist.MoveNext()) + { + int f_id = clist.Current.Value.CursorID; + if (f_id > maxCursor25DID) maxCursor25DID = f_id; + } + + List freeCursorBuffer = new List(); + IEnumerator flist = freeCursor25DList.GetEnumerator(); + while (flist.MoveNext()) + { + TuioCursor25D testCursor = flist.Current; + if (testCursor.CursorID < maxCursor25DID) freeCursorBuffer.Add(testCursor); + } + freeCursor25DList = freeCursorBuffer; + } + else freeCursor25DList.Clear(); + } + else if (removeCursor.CursorID < maxCursor25DID) freeCursor25DList.Add(removeCursor); + } + break; + + case TuioCursor.TUIO_ADDED: + TuioCursor25D addCursor; + lock (cursor25DSync) + { + int c_id = cursor25DList.Count; + if ((cursor25DList.Count <= maxCursor25DID) && (freeCursor25DList.Count > 0)) + { + TuioCursor25D closestCursor = freeCursor25DList[0]; + IEnumerator testList = freeCursor25DList.GetEnumerator(); + while (testList.MoveNext()) + { + TuioCursor25D testCursor = testList.Current; + if (testCursor.getDistance(tcur) < closestCursor.getDistance(tcur)) closestCursor = testCursor; + } + c_id = closestCursor.CursorID; + freeCursor25DList.Remove(closestCursor); + } + else maxCursor25DID = c_id; + + addCursor = new TuioCursor25D(currentTime, tcur.SessionID, c_id, tcur.X, tcur.Y, tcur.Z); + cursor25DList.Add(addCursor.SessionID, addCursor); + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.addTuioCursor25D(addCursor); + } + break; + + default: + TuioCursor25D updateCursor = getTuioCursor25D(tcur.SessionID); + if ((tcur.X != updateCursor.X && tcur.XSpeed == 0) || (tcur.Y != updateCursor.Y && tcur.YSpeed == 0) || (tcur.Z != updateCursor.Z && tcur.ZSpeed == 0)) + updateCursor.update(currentTime, tcur.X, tcur.Y, tcur.Z); + else + updateCursor.update(currentTime, tcur.X, tcur.Y, tcur.Z, tcur.XSpeed, tcur.YSpeed, tcur.ZSpeed, tcur.MotionAccel); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.updateTuioCursor25D(updateCursor); + } + break; + } + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.refresh(new TuioTime(currentTime)); + } + + List buffer = aliveCursor25DList; + aliveCursor25DList = newCursor25DList; + // recycling the List + newCursor25DList = buffer; + } + frameCursors25D.Clear(); + } + + } + else if (address == "/tuio/25Dblb") + { + + if (command == "set") + { + + long s_id = (int)args[1]; + float xpos = (float)args[2]; + float ypos = (float)args[3]; + float zpos = (float)args[4]; + float angle = (float)args[5]; + float width = (float)args[6]; + float height = (float)args[7]; + float area = (float)args[8]; + float xspeed = (float)args[9]; + float yspeed = (float)args[10]; + float zspeed = (float)args[11]; + float rspeed = (float)args[12]; + float maccel = (float)args[13]; + float raccel = (float)args[14]; + + lock (blob25DList) + { + if (!blob25DList.ContainsKey(s_id)) + { + TuioBlob25D addBlob = new TuioBlob25D(s_id, -1, xpos, ypos,zpos, angle, width, height, area); + frameBlobs25D.Add(addBlob); + } + else + { + TuioBlob25D tblb = (TuioBlob25D)blob25DList[s_id]; + if (tblb == null) return; + if ((tblb.X != xpos) || (tblb.Y != ypos) || (tblb.Z != zpos) || (tblb.Angle != angle) || (tblb.Width != width) || (tblb.Height != height) || (tblb.Area != area) || (tblb.XSpeed != xspeed) || (tblb.YSpeed != yspeed) || (tblb.ZSpeed != zspeed) || (tblb.RotationSpeed != rspeed) || (tblb.MotionAccel != maccel) || (tblb.RotationAccel != raccel)) + { + TuioBlob25D updateBlob = new TuioBlob25D(s_id, tblb.BlobID, xpos, ypos,zpos, angle, width, height, area); + updateBlob.update(xpos, ypos,zpos, angle, width, height, area, xspeed, yspeed,zspeed, rspeed, maccel, raccel); + frameBlobs25D.Add(updateBlob); + } + } + } + + } + else if (command == "alive") + { + + newBlob25DList.Clear(); + for (int i = 1; i < args.Count; i++) + { + // get the message content + long s_id = (int)args[i]; + newBlob25DList.Add(s_id); + // reduce the blob list to the lost blobs + if (aliveBlob25DList.Contains(s_id)) + aliveBlob25DList.Remove(s_id); + } + + // remove the remaining blobs + lock (blob25DSync) + { + for (int i = 0; i < aliveBlob25DList.Count; i++) + { + long s_id = aliveBlob25DList[i]; + if (!blob25DList.ContainsKey(s_id)) continue; + TuioBlob25D removeBlob = blob25DList[s_id]; + removeBlob.remove(currentTime); + frameBlobs25D.Add(removeBlob); + } + } + + } + else if (command == "fseq") + { + int fseq = (int)args[1]; + bool lateFrame = false; + + if (fseq > 0) + { + if (fseq > currentFrame) currentTime = TuioTime.SessionTime; + if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; + else lateFrame = true; + } + else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) + { + currentTime = TuioTime.SessionTime; + } + + if (!lateFrame) + { + + IEnumerator frameEnum = frameBlobs25D.GetEnumerator(); + while (frameEnum.MoveNext()) + { + TuioBlob25D tblb = frameEnum.Current; + switch (tblb.TuioState) + { + case TuioBlob25D.TUIO_REMOVED: + TuioBlob25D removeBlob = tblb; + removeBlob.remove(currentTime); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.removeTuioBlob25D(removeBlob); + } + lock (blob25DSync) + { + blob25DList.Remove(removeBlob.SessionID); + + if (removeBlob.BlobID == maxBlob25DID) + { + maxBlob25DID = -1; + + if (blob25DList.Count > 0) + { + + IEnumerator> blist = blob25DList.GetEnumerator(); + while (blist.MoveNext()) + { + int b_id = blist.Current.Value.BlobID; + if (b_id > maxBlob25DID) maxBlob25DID = b_id; + } + + List freeBlobBuffer = new List(); + IEnumerator flist = freeBlob25DList.GetEnumerator(); + while (flist.MoveNext()) + { + TuioBlob25D testBlob = flist.Current; + if (testBlob.BlobID < maxBlob25DID) freeBlobBuffer.Add(testBlob); + } + freeBlob25DList = freeBlobBuffer; + } + else freeBlob25DList.Clear(); + } + else if (removeBlob.BlobID < maxBlob25DID) freeBlob25DList.Add(removeBlob); + } + break; + + case TuioBlob25D.TUIO_ADDED: + TuioBlob25D addBlob; + lock (blob25DSync) + { + int b_id = blob25DList.Count; + if ((blob25DList.Count <= maxBlob25DID) && (freeBlob25DList.Count > 0)) + { + TuioBlob25D closestBlob = freeBlob25DList[0]; + IEnumerator testList = freeBlob25DList.GetEnumerator(); + while (testList.MoveNext()) + { + TuioBlob25D testBlob = testList.Current; + if (testBlob.getDistance(tblb) < closestBlob.getDistance(tblb)) closestBlob = testBlob; + } + b_id = closestBlob.BlobID; + freeBlob25DList.Remove(closestBlob); + } + else maxBlob25DID = b_id; + + addBlob = new TuioBlob25D(currentTime, tblb.SessionID, b_id, tblb.X, tblb.Y, tblb.Z, tblb.Angle, tblb.Width, tblb.Height, tblb.Area); + blob25DList.Add(addBlob.SessionID, addBlob); + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.addTuioBlob25D(addBlob); + } + break; + + default: + TuioBlob25D updateBlob = getTuioBlob25D(tblb.SessionID); + if ((tblb.X != updateBlob.X && tblb.XSpeed == 0) || (tblb.Y != updateBlob.Y && tblb.YSpeed == 0) || (tblb.Z != updateBlob.Z && tblb.ZSpeed == 0) || (tblb.Angle != updateBlob.Angle && tblb.RotationSpeed == 0)) + updateBlob.update(currentTime, tblb.X, tblb.Y, tblb.Z, tblb.Angle, tblb.Width, tblb.Height, tblb.Area); + else + updateBlob.update(currentTime, tblb.X, tblb.Y, tblb.Z, tblb.Angle, tblb.Width, tblb.Height, tblb.Area, tblb.XSpeed, tblb.YSpeed, tblb.ZSpeed, tblb.RotationSpeed, tblb.MotionAccel, tblb.RotationAccel); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.updateTuioBlob25D(updateBlob); + } + break; + } + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.refresh(new TuioTime(currentTime)); + } + + List buffer = aliveBlob25DList; + aliveBlob25DList = newBlob25DList; + // recycling the List + newBlob25DList = buffer; + } + frameBlobs25D.Clear(); + } + + } + else if (address == "/tuio/3Dobj") + { + if (command == "set") + { + + long s_id = (int)args[1]; + int f_id = (int)args[2]; + float xpos = (float)args[3]; + float ypos = (float)args[4]; + float zpos = (float)args[5]; + float roll = (float)args[6]; + float pitch = (float)args[7]; + float yaw = (float)args[8]; + float xspeed = (float)args[9]; + float yspeed = (float)args[10]; + float zspeed = (float)args[11]; + float rollspeed = (float)args[12]; + float pitchspeed = (float)args[13]; + float yawspeed = (float)args[14]; + float maccel = (float)args[15]; + float raccel = (float)args[16]; + + lock (object3DSync) + { + if (!object3DList.ContainsKey(s_id)) + { + TuioObject3D addObject = new TuioObject3D(s_id, f_id, xpos, ypos, zpos, roll, pitch, yaw); + frameObjects3D.Add(addObject); + } + else + { + TuioObject3D tobj = object3DList[s_id]; + if (tobj == null) return; + if ((tobj.X != xpos) || (tobj.Y != ypos) || (tobj.Z != zpos) || (tobj.Roll != roll) || (tobj.Pitch != pitch) || (tobj.Yaw != yaw) || (tobj.XSpeed != xspeed) || (tobj.YSpeed != yspeed) || (tobj.ZSpeed != zspeed) || (tobj.RollSpeed != rollspeed) || (tobj.PitchSpeed != pitchspeed) || (tobj.YawSpeed != yawspeed) || (tobj.MotionAccel != maccel) || (tobj.RotationAccel != raccel)) + { + + TuioObject3D updateObject = new TuioObject3D(s_id, f_id, xpos, ypos, zpos, roll, pitch, yaw); + updateObject.update(xpos, ypos, zpos, roll, pitch, yaw, xspeed, yspeed, zspeed, rollspeed, pitchspeed, yawspeed, maccel, raccel); + frameObjects3D.Add(updateObject); + } + } + } + + } + else if (command == "alive") + { + + newObject3DList.Clear(); + for (int i = 1; i < args.Count; i++) + { + // get the message content + long s_id = (int)args[i]; + newObject3DList.Add(s_id); + // reduce the object list to the lost objects + if (aliveObject3DList.Contains(s_id)) + aliveObject3DList.Remove(s_id); + } + + // remove the remaining objects + lock (object3DSync) + { + for (int i = 0; i < aliveObject3DList.Count; i++) + { + long s_id = aliveObject3DList[i]; + TuioObject3D removeObject = object3DList[s_id]; + removeObject.remove(currentTime); + frameObjects3D.Add(removeObject); + } + } + + } + else if (command == "fseq") + { + int fseq = (int)args[1]; + bool lateFrame = false; + + if (fseq > 0) + { + if (fseq > currentFrame) currentTime = TuioTime.SessionTime; + if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; + else lateFrame = true; + } + else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) + { + currentTime = TuioTime.SessionTime; + } + + if (!lateFrame) + { + + IEnumerator frameEnum = frameObjects3D.GetEnumerator(); + while (frameEnum.MoveNext()) + { + TuioObject3D tobj = frameEnum.Current; + + switch (tobj.TuioState) + { + case TuioObject3D.TUIO_REMOVED: + TuioObject3D removeObject = tobj; + removeObject.remove(currentTime); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.removeTuioObject3D(removeObject); + } + lock (object3DSync) + { + object3DList.Remove(removeObject.SessionID); + } + break; + case TuioObject3D.TUIO_ADDED: + TuioObject3D addObject = new TuioObject3D(currentTime, tobj.SessionID, tobj.SymbolID, tobj.X, tobj.Y, tobj.Z, tobj.Roll, tobj.Pitch, tobj.Yaw); + lock (object3DSync) + { + object3DList.Add(addObject.SessionID, addObject); + } + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.addTuioObject3D(addObject); + } + break; + default: + TuioObject3D updateObject = getTuioObject3D(tobj.SessionID); + if ((tobj.X != updateObject.X && tobj.XSpeed == 0) || (tobj.Y != updateObject.Y && tobj.YSpeed == 0) || (tobj.Z != updateObject.Z && tobj.ZSpeed == 0) || (tobj.Roll != updateObject.Roll && tobj.RollSpeed == 0) || (tobj.Pitch != updateObject.Pitch && tobj.PitchSpeed == 0)|| (tobj.Yaw != updateObject.Yaw && tobj.YawSpeed == 0)) + updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Z, tobj.Roll, tobj.Pitch, tobj.Yaw); + else + updateObject.update(currentTime, tobj.X, tobj.Y, tobj.Z, tobj.Roll, tobj.Pitch, tobj.Yaw, tobj.XSpeed, tobj.YSpeed, tobj.ZSpeed, tobj.RollSpeed, tobj.PitchSpeed, tobj.YawSpeed, tobj.MotionAccel, tobj.RotationAccel); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.updateTuioObject3D(updateObject); + } + break; + } + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.refresh(new TuioTime(currentTime)); + } + + List buffer = aliveObject3DList; + aliveObject3DList = newObject3DList; + // recycling the List + newObject3DList = buffer; + } + frameObjects3D.Clear(); + } + + } + else if (address == "/tuio/3Dcur") + { + + if (command == "set") + { + + long s_id = (int)args[1]; + float xpos = (float)args[2]; + float ypos = (float)args[3]; + float zpos = (float)args[4]; + float xspeed = (float)args[5]; + float yspeed = (float)args[6]; + float zspeed = (float)args[7]; + float maccel = (float)args[8]; + + lock (cursor3DList) + { + if (!cursor3DList.ContainsKey(s_id)) + { + + TuioCursor3D addCursor = new TuioCursor3D(s_id, -1, xpos, ypos, zpos); + frameCursors3D.Add(addCursor); + + } + else + { + TuioCursor3D tcur = (TuioCursor3D)cursor3DList[s_id]; + if (tcur == null) return; + if ((tcur.X != xpos) || (tcur.Y != ypos) || (tcur.Z != zpos) || (tcur.XSpeed != xspeed) || (tcur.YSpeed != yspeed) || (tcur.ZSpeed != zspeed) || (tcur.MotionAccel != maccel)) + { + TuioCursor3D updateCursor = new TuioCursor3D(s_id, tcur.CursorID, xpos, ypos, zpos); + updateCursor.update(xpos, ypos, zpos, xspeed, yspeed, zspeed, maccel); + frameCursors3D.Add(updateCursor); + } + } + } + + } + else if (command == "alive") + { + + newCursor3DList.Clear(); + for (int i = 1; i < args.Count; i++) + { + // get the message content + long s_id = (int)args[i]; + newCursor3DList.Add(s_id); + // reduce the cursor list to the lost cursors + if (aliveCursor3DList.Contains(s_id)) + aliveCursor3DList.Remove(s_id); + } + + // remove the remaining cursors + lock (cursor3DSync) + { + for (int i = 0; i < aliveCursor3DList.Count; i++) + { + long s_id = aliveCursor3DList[i]; + if (!cursor3DList.ContainsKey(s_id)) continue; + TuioCursor3D removeCursor = cursor3DList[s_id]; + removeCursor.remove(currentTime); + frameCursors3D.Add(removeCursor); + } + } + + } + else if (command == "fseq") + { + int fseq = (int)args[1]; + bool lateFrame = false; + + if (fseq > 0) + { + if (fseq > currentFrame) currentTime = TuioTime.SessionTime; + if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; + else lateFrame = true; + } + else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) + { + currentTime = TuioTime.SessionTime; + } + + if (!lateFrame) + { + + IEnumerator frameEnum = frameCursors3D.GetEnumerator(); + while (frameEnum.MoveNext()) + { + TuioCursor3D tcur = frameEnum.Current; + switch (tcur.TuioState) + { + case TuioCursor.TUIO_REMOVED: + TuioCursor3D removeCursor = tcur; + removeCursor.remove(currentTime); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.removeTuioCursor3D(removeCursor); + } + lock (cursor3DSync) + { + cursor3DList.Remove(removeCursor.SessionID); + + if (removeCursor.CursorID == maxCursor3DID) + { + maxCursor3DID = -1; + + if (cursor3DList.Count > 0) + { + + IEnumerator> clist = cursor3DList.GetEnumerator(); + while (clist.MoveNext()) + { + int f_id = clist.Current.Value.CursorID; + if (f_id > maxCursor3DID) maxCursor3DID = f_id; + } + + List freeCursorBuffer = new List(); + IEnumerator flist = freeCursor3DList.GetEnumerator(); + while (flist.MoveNext()) + { + TuioCursor3D testCursor = flist.Current; + if (testCursor.CursorID < maxCursor3DID) freeCursorBuffer.Add(testCursor); + } + freeCursor3DList = freeCursorBuffer; + } + else freeCursor3DList.Clear(); + } + else if (removeCursor.CursorID < maxCursor3DID) freeCursor3DList.Add(removeCursor); + } + break; + + case TuioCursor.TUIO_ADDED: + TuioCursor3D addCursor; + lock (cursor3DSync) + { + int c_id = cursor3DList.Count; + if ((cursor3DList.Count <= maxCursor3DID) && (freeCursor3DList.Count > 0)) + { + TuioCursor3D closestCursor = freeCursor3DList[0]; + IEnumerator testList = freeCursor3DList.GetEnumerator(); + while (testList.MoveNext()) + { + TuioCursor3D testCursor = testList.Current; + if (testCursor.getDistance(tcur) < closestCursor.getDistance(tcur)) closestCursor = testCursor; + } + c_id = closestCursor.CursorID; + freeCursor3DList.Remove(closestCursor); + } + else maxCursor3DID = c_id; + + addCursor = new TuioCursor3D(currentTime, tcur.SessionID, c_id, tcur.X, tcur.Y, tcur.Z); + cursor3DList.Add(addCursor.SessionID, addCursor); + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.addTuioCursor3D(addCursor); + } + break; + + default: + TuioCursor3D updateCursor = getTuioCursor3D(tcur.SessionID); + if ((tcur.X != updateCursor.X && tcur.XSpeed == 0) || (tcur.Y != updateCursor.Y && tcur.YSpeed == 0) || (tcur.Z != updateCursor.Z && tcur.ZSpeed == 0)) + updateCursor.update(currentTime, tcur.X, tcur.Y, tcur.Z); + else + updateCursor.update(currentTime, tcur.X, tcur.Y, tcur.Z, tcur.XSpeed, tcur.YSpeed, tcur.ZSpeed, tcur.MotionAccel); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.updateTuioCursor3D(updateCursor); + } + break; + } + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.refresh(new TuioTime(currentTime)); + } + + List buffer = aliveCursor3DList; + aliveCursor3DList = newCursor3DList; + // recycling the List + newCursor3DList = buffer; + } + frameCursors3D.Clear(); + } + + } + else if (address == "/tuio/3Dblb") + { + + if (command == "set") + { + + long s_id = (int)args[1]; + float xpos = (float)args[2]; + float ypos = (float)args[3]; + float zpos = (float)args[4]; + float roll = (float)args[5]; + float pitch = (float)args[6]; + float yaw = (float)args[7]; + float width = (float)args[8]; + float height = (float)args[9]; + float depth = (float)args[10]; + float volume = (float)args[11]; + float xspeed = (float)args[12]; + float yspeed = (float)args[13]; + float zspeed = (float)args[14]; + float rollspeed = (float)args[15]; + float pitchspeed = (float)args[16]; + float yawspeed = (float)args[17]; + float maccel = (float)args[18]; + float raccel = (float)args[19]; + + lock (blob3DList) + { + if (!blob3DList.ContainsKey(s_id)) + { + TuioBlob3D addBlob = new TuioBlob3D(s_id, -1, xpos, ypos, zpos, roll, pitch, yaw, width, height, depth, volume); + frameBlobs3D.Add(addBlob); + } + else + { + TuioBlob3D tblb = (TuioBlob3D)blob3DList[s_id]; + if (tblb == null) return; + if ((tblb.X != xpos) || (tblb.Y != ypos) || (tblb.Z != zpos) || (tblb.Roll != roll) || (tblb.Pitch != pitch) || (tblb.Yaw != yaw) || (tblb.Width != width) || (tblb.Height != height) || (tblb.Depth != depth) || (tblb.Volume != volume) || (tblb.XSpeed != xspeed) || (tblb.YSpeed != yspeed) || (tblb.ZSpeed != zspeed) || (tblb.RollSpeed != rollspeed) || (tblb.PitchSpeed != pitchspeed) || (tblb.YawSpeed != yawspeed) || (tblb.MotionAccel != maccel) || (tblb.RotationAccel != raccel)) + { + TuioBlob3D updateBlob = new TuioBlob3D(s_id, tblb.BlobID, xpos, ypos, zpos, roll, pitch, yaw, width, height, depth, volume); + updateBlob.update(xpos, ypos, zpos, roll, pitch, yaw, width, height, depth, volume, xspeed, yspeed, zspeed, rollspeed, pitchspeed, yawspeed, maccel, raccel); + frameBlobs3D.Add(updateBlob); + } + } + } + + } + else if (command == "alive") + { + + newBlob3DList.Clear(); + for (int i = 1; i < args.Count; i++) + { + // get the message content + long s_id = (int)args[i]; + newBlob3DList.Add(s_id); + // reduce the blob list to the lost blobs + if (aliveBlob3DList.Contains(s_id)) + aliveBlob3DList.Remove(s_id); + } + + // remove the remaining blobs + lock (blob3DSync) + { + for (int i = 0; i < aliveBlob3DList.Count; i++) + { + long s_id = aliveBlob3DList[i]; + if (!blob3DList.ContainsKey(s_id)) continue; + TuioBlob3D removeBlob = blob3DList[s_id]; + removeBlob.remove(currentTime); + frameBlobs3D.Add(removeBlob); + } + } + + } + else if (command == "fseq") + { + int fseq = (int)args[1]; + bool lateFrame = false; + + if (fseq > 0) + { + if (fseq > currentFrame) currentTime = TuioTime.SessionTime; + if ((fseq >= currentFrame) || ((currentFrame - fseq) > 100)) currentFrame = fseq; + else lateFrame = true; + } + else if ((TuioTime.SessionTime.TotalMilliseconds - currentTime.TotalMilliseconds) > 100) + { + currentTime = TuioTime.SessionTime; + } + + if (!lateFrame) + { + + IEnumerator frameEnum = frameBlobs3D.GetEnumerator(); + while (frameEnum.MoveNext()) + { + TuioBlob3D tblb = frameEnum.Current; + switch (tblb.TuioState) + { + case TuioBlob3D.TUIO_REMOVED: + TuioBlob3D removeBlob = tblb; + removeBlob.remove(currentTime); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.removeTuioBlob3D(removeBlob); + } + lock (blob3DSync) + { + blob3DList.Remove(removeBlob.SessionID); + + if (removeBlob.BlobID == maxBlob3DID) + { + maxBlob3DID = -1; + + if (blob3DList.Count > 0) + { + + IEnumerator> blist = blob3DList.GetEnumerator(); + while (blist.MoveNext()) + { + int b_id = blist.Current.Value.BlobID; + if (b_id > maxBlob3DID) maxBlob3DID = b_id; + } + + List freeBlobBuffer = new List(); + IEnumerator flist = freeBlob3DList.GetEnumerator(); + while (flist.MoveNext()) + { + TuioBlob3D testBlob = flist.Current; + if (testBlob.BlobID < maxBlob3DID) freeBlobBuffer.Add(testBlob); + } + freeBlob3DList = freeBlobBuffer; + } + else freeBlob3DList.Clear(); + } + else if (removeBlob.BlobID < maxBlob3DID) freeBlob3DList.Add(removeBlob); + } + break; + + case TuioBlob3D.TUIO_ADDED: + TuioBlob3D addBlob; + lock (blob3DSync) + { + int b_id = blob3DList.Count; + if ((blob3DList.Count <= maxBlob3DID) && (freeBlob3DList.Count > 0)) + { + TuioBlob3D closestBlob = freeBlob3DList[0]; + IEnumerator testList = freeBlob3DList.GetEnumerator(); + while (testList.MoveNext()) + { + TuioBlob3D testBlob = testList.Current; + if (testBlob.getDistance(tblb) < closestBlob.getDistance(tblb)) closestBlob = testBlob; + } + b_id = closestBlob.BlobID; + freeBlob3DList.Remove(closestBlob); + } + else maxBlob3DID = b_id; + + addBlob = new TuioBlob3D(currentTime, tblb.SessionID, b_id, tblb.X, tblb.Y, tblb.Z, tblb.Roll, tblb.Pitch, tblb.Yaw, tblb.Width, tblb.Height, tblb.Depth,tblb.Volume); + blob3DList.Add(addBlob.SessionID, addBlob); + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.addTuioBlob3D(addBlob); + } + break; + + default: + TuioBlob3D updateBlob = getTuioBlob3D(tblb.SessionID); + if ((tblb.X != updateBlob.X && tblb.XSpeed == 0) || (tblb.Y != updateBlob.Y && tblb.YSpeed == 0) || (tblb.Z != updateBlob.Z && tblb.ZSpeed == 0) || (tblb.Roll != updateBlob.Roll && tblb.RollSpeed == 0) || (tblb.Pitch != updateBlob.Pitch && tblb.PitchSpeed == 0) || (tblb.Yaw != updateBlob.Yaw && tblb.YawSpeed == 0)) + updateBlob.update(currentTime, tblb.X, tblb.Y, tblb.Z, tblb.Roll, tblb.Pitch, tblb.Yaw, tblb.Width, tblb.Height, tblb.Depth, tblb.Volume); + else + updateBlob.update(currentTime, tblb.X, tblb.Y, tblb.Z, tblb.Roll, tblb.Pitch, tblb.Yaw, tblb.Width, tblb.Height, tblb.Depth, tblb.Volume, tblb.XSpeed, tblb.YSpeed, tblb.ZSpeed, tblb.RollSpeed, tblb.PitchSpeed, tblb.YawSpeed, tblb.MotionAccel, tblb.RotationAccel); + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.updateTuioBlob3D(updateBlob); + } + break; + } + } + + for (int i = 0; i < listenerList.Count; i++) + { + TuioListener listener = (TuioListener)listenerList[i]; + if (listener != null) listener.refresh(new TuioTime(currentTime)); + } + + List buffer = aliveBlob3DList; + aliveBlob3DList = newBlob3DList; + // recycling the List + newBlob3DList = buffer; + } + frameBlobs3D.Clear(); + } + + } + } + + #region Listener Management + /** + * + * Adds the provided TuioListener to the list of registered TUIO event listeners + * the TuioListener to add + */ + public void addTuioListener(TuioListener listener) + { + listenerList.Add(listener); + } + + /** + * + * Removes the provided TuioListener from the list of registered TUIO event listeners + * the TuioListener to remove + */ + public void removeTuioListener(TuioListener listener) + { + listenerList.Remove(listener); + } + + /** + * + * Removes all TuioListener from the list of registered TUIO event listeners + */ + public void removeAllTuioListeners() + { + listenerList.Clear(); + } + #endregion + + #region Object Management + + /** + * + * Returns a List of all currently active TuioObjects + * a List of all currently active TuioObjects + */ + public List getTuioObjects() + { + List listBuffer; + lock (objectSync) + { + listBuffer = new List(objectList.Values); + } + return listBuffer; + } + + /** + * + * Returns a List of all currently active TuioCursors + * a List of all currently active TuioCursors + */ + public List getTuioCursors() + { + List listBuffer; + lock (cursorSync) + { + listBuffer = new List(cursorList.Values); + } + return listBuffer; + } + + /** + * + * Returns a List of all currently active TuioBlobs + * a List of all currently active TuioBlobs + */ + public List getTuioBlobs() + { + List listBuffer; + lock (blobSync) + { + listBuffer = new List(blobList.Values); + } + return listBuffer; + } + + /** + * + * Returns the TuioObject corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioObject + * an active TuioObject corresponding to the provided Session ID or NULL + */ + public TuioObject getTuioObject(long s_id) + { + TuioObject tobject = null; + lock (objectSync) + { + objectList.TryGetValue(s_id, out tobject); + } + return tobject; + } + + /** + * + * Returns the TuioCursor corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioCursor + * an active TuioCursor corresponding to the provided Session ID or NULL + */ + public TuioCursor getTuioCursor(long s_id) + { + TuioCursor tcursor = null; + lock (cursorSync) + { + cursorList.TryGetValue(s_id, out tcursor); + } + return tcursor; + } + + /** + * + * Returns the TuioBlob corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioBlob + * an active TuioBlob corresponding to the provided Session ID or NULL + */ + public TuioBlob getTuioBlob(long s_id) + { + TuioBlob tblob = null; + lock (blobSync) + { + blobList.TryGetValue(s_id, out tblob); + } + return tblob; + } + + + + + /** + * + * Returns a List of all currently active TuioObjects25D + * a List of all currently active TuioObjects25D + */ + public List getTuioObjects25D() + { + List listBuffer; + lock (object25DSync) + { + listBuffer = new List(object25DList.Values); + } + return listBuffer; + } + + /** + * + * Returns a List of all currently active TuioCursors25D + * a List of all currently active TuioCursors25D + */ + public List getTuioCursors25D() + { + List listBuffer; + lock (cursor25DSync) + { + listBuffer = new List(cursor25DList.Values); + } + return listBuffer; + } + + /** + * + * Returns a List of all currently active TuioBlobs25D + * a List of all currently active TuioBlobs25D + */ + public List getTuioBlobs25D() + { + List listBuffer; + lock (blob25DSync) + { + listBuffer = new List(blob25DList.Values); + } + return listBuffer; + } + + /** + * + * Returns the TuioObject25D corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioObject25D + * an active TuioObject25D corresponding to the provided Session ID or NULL + */ + public TuioObject25D getTuioObject25D(long s_id) + { + TuioObject25D tobject = null; + lock (object25DSync) + { + object25DList.TryGetValue(s_id, out tobject); + } + return tobject; + } + + /** + * + * Returns the TuioCursor25D corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioCursor25D + * an active TuioCursor25D corresponding to the provided Session ID or NULL + */ + public TuioCursor25D getTuioCursor25D(long s_id) + { + TuioCursor25D tcursor = null; + lock (cursor25DSync) + { + cursor25DList.TryGetValue(s_id, out tcursor); + } + return tcursor; + } + + /** + * + * Returns the TuioBlob25D corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioBlob25D + * an active TuioBlob25D corresponding to the provided Session ID or NULL + */ + public TuioBlob25D getTuioBlob25D(long s_id) + { + TuioBlob25D tblob = null; + lock (blob25DSync) + { + blob25DList.TryGetValue(s_id, out tblob); + } + return tblob; + } + + + + + + + /** + * + * Returns a List of all currently active TuioObjects3D + * a List of all currently active TuioObjects3D + */ + public List getTuioObjects3D() + { + List listBuffer; + lock (object3DSync) + { + listBuffer = new List(object3DList.Values); + } + return listBuffer; + } + + /** + * + * Returns a List of all currently active TuioCursors3D + * a List of all currently active TuioCursors3D + */ + public List getTuioCursors3D() + { + List listBuffer; + lock (cursor3DSync) + { + listBuffer = new List(cursor3DList.Values); + } + return listBuffer; + } + + /** + * + * Returns a List of all currently active TuioBlobs3D + * a List of all currently active TuioBlobs3D + */ + public List getTuioBlobs3D() + { + List listBuffer; + lock (blob3DSync) + { + listBuffer = new List(blob3DList.Values); + } + return listBuffer; + } + + /** + * + * Returns the TuioObject3D corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioObject3D + * an active TuioObject3D corresponding to the provided Session ID or NULL + */ + public TuioObject3D getTuioObject3D(long s_id) + { + TuioObject3D tobject = null; + lock (object3DSync) + { + object3DList.TryGetValue(s_id, out tobject); + } + return tobject; + } + + /** + * + * Returns the TuioCursor3D corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioCursor3D + * an active TuioCursor3D corresponding to the provided Session ID or NULL + */ + public TuioCursor3D getTuioCursor3D(long s_id) + { + TuioCursor3D tcursor = null; + lock (cursor3DSync) + { + cursor3DList.TryGetValue(s_id, out tcursor); + } + return tcursor; + } + + /** + * + * Returns the TuioBlob3D corresponding to the provided Session ID + * or NULL if the Session ID does not refer to an active TuioBlob3D + * an active TuioBlob3D corresponding to the provided Session ID or NULL + */ + public TuioBlob3D getTuioBlob3D(long s_id) + { + TuioBlob3D tblob = null; + lock (blob3DSync) + { + blob3DList.TryGetValue(s_id, out tblob); + } + return tblob; + } + + + + + + + + + + + + + + + - /** - * - * Returns the TuioBlob corresponding to the provided Session ID - * or NULL if the Session ID does not refer to an active TuioBlob - * an active TuioBlob corresponding to the provided Session ID or NULL - */ - public TuioBlob getTuioBlob(long s_id) - { - TuioBlob tblob = null; - lock (blobSync) - { - blobList.TryGetValue(s_id, out tblob); - } - return tblob; - } #endregion } diff --git a/TUIO/TuioContainer.cs b/TUIO/TuioContainer.cs index 291edf3..281ec03 100644 --- a/TUIO/TuioContainer.cs +++ b/TUIO/TuioContainer.cs @@ -49,6 +49,11 @@ public abstract class TuioContainer : TuioPoint * The Y-axis velocity value. */ protected float y_speed; + /** + * + * The Z-axis velocity value. + */ + protected float z_speed; /** * * The motion speed value. @@ -66,31 +71,38 @@ public abstract class TuioContainer : TuioPoint protected LinkedList path; #region State Enumeration Values + /** + * + * Defines the REMOVED state. + */ + public const int TUIO_IDLE = 0; /** * * Defines the ADDED state. */ - public const int TUIO_ADDED = 0; + public const int TUIO_ADDED = 1; /** * * Defines the ACCELERATING state. */ - public const int TUIO_ACCELERATING = 1; + public const int TUIO_ACCELERATING = 2; /** * * Defines the DECELERATING state. */ - public const int TUIO_DECELERATING = 2; + public const int TUIO_DECELERATING = 3; + /** * * Defines the STOPPED state. */ - public const int TUIO_STOPPED = 3; + public const int TUIO_STOPPED = 5; /** * * Defines the REMOVED state. */ - public const int TUIO_REMOVED = 4; + public const int TUIO_REMOVED = 6; + #endregion /** * @@ -109,18 +121,20 @@ public abstract class TuioContainer : TuioPoint * the Session ID to assign * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public TuioContainer(TuioTime ttime, long si, float xp, float yp) - : base(ttime, xp, yp) + public TuioContainer(TuioTime ttime, long si, float xp, float yp, float zp) + : base(ttime, xp, yp,zp) { session_id = si; x_speed = 0.0f; y_speed = 0.0f; + z_speed = 0.0f; motion_speed = 0.0f; motion_accel = 0.0f; path = new LinkedList(); - path.AddLast(new TuioPoint(currentTime, xpos, ypos)); + path.AddLast(new TuioPoint(currentTime, xpos, ypos,zpos)); state = TUIO_ADDED; } @@ -132,17 +146,19 @@ public TuioContainer(TuioTime ttime, long si, float xp, float yp) * the Session ID to assign * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public TuioContainer(long si, float xp, float yp) - : base(xp, yp) + public TuioContainer(long si, float xp, float yp, float zp) + : base(xp, yp, zp) { session_id = si; x_speed = 0.0f; y_speed = 0.0f; + z_speed = 0.0f; motion_speed = 0.0f; motion_accel = 0.0f; path = new LinkedList(); - path.AddLast(new TuioPoint(currentTime, xpos, ypos)); + path.AddLast(new TuioPoint(currentTime, xpos, ypos,zpos)); state = TUIO_ADDED; } @@ -162,7 +178,7 @@ public TuioContainer(TuioContainer tcon) motion_speed = 0.0f; motion_accel = 0.0f; path = new LinkedList(); - path.AddLast(new TuioPoint(currentTime, xpos, ypos)); + path.AddLast(new TuioPoint(currentTime, xpos, ypos,zpos)); state = TUIO_ADDED; } #endregion @@ -177,21 +193,24 @@ public TuioContainer(TuioContainer tcon) * the TuioTime to assign * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public new void update(TuioTime ttime, float xp, float yp) + public new void update(TuioTime ttime, float xp, float yp, float zp) { TuioPoint lastPoint = path.Last.Value; - base.update(ttime, xp, yp); + base.update(ttime, xp, yp, zp); TuioTime diffTime = currentTime - lastPoint.TuioTime; float dt = diffTime.TotalMilliseconds / 1000.0f; float dx = this.xpos - lastPoint.X; float dy = this.ypos - lastPoint.Y; - float dist = (float)Math.Sqrt(dx * dx + dy * dy); + float dz = this.zpos - lastPoint.Z; + float dist = (float)Math.Sqrt(dx * dx + dy * dy + dz * dz); float last_motion_speed = this.motion_speed; this.x_speed = dx / dt; this.y_speed = dy / dt; + this.z_speed = dz / dt; this.motion_speed = dist / dt; this.motion_accel = (motion_speed - last_motion_speed) / dt; @@ -200,7 +219,7 @@ public TuioContainer(TuioContainer tcon) else state = TUIO_STOPPED; lock (path) { - path.AddLast (new TuioPoint (currentTime, xpos, ypos)); + path.AddLast (new TuioPoint (currentTime, xpos, ypos,zpos)); if (path.Count > 128) path.RemoveFirst (); } } @@ -212,7 +231,7 @@ public TuioContainer(TuioContainer tcon) */ public void stop(TuioTime ttime) { - update(ttime, this.xpos, this.ypos); + update(ttime, this.xpos, this.ypos, this.zpos); } /** @@ -224,16 +243,19 @@ public void stop(TuioTime ttime) * the TuioTime to assign * the X coordinate to assign * the Y coordinate to assign + * the Y coordinate to assign * the X velocity to assign * the Y velocity to assign + * the Y velocity to assign * the acceleration to assign */ - public void update(TuioTime ttime, float xp, float yp, float xs, float ys, float ma) + public void update(TuioTime ttime, float xp, float yp, float zp, float xs, float ys, float zs, float ma) { - base.update(ttime, xp, yp); + base.update(ttime, xp, yp,zp); x_speed = xs; y_speed = ys; - motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); + z_speed = zs; + motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed + z_speed * z_speed); motion_accel = ma; if (motion_accel > 0) state = TUIO_ACCELERATING; @@ -241,7 +263,7 @@ public void update(TuioTime ttime, float xp, float yp, float xs, float ys, float else state = TUIO_STOPPED; lock (path) { - path.AddLast (new TuioPoint (currentTime, xpos, ypos)); + path.AddLast (new TuioPoint (currentTime, xpos, ypos,zpos)); if (path.Count > 128) path.RemoveFirst (); } } @@ -253,17 +275,20 @@ public void update(TuioTime ttime, float xp, float yp, float xs, float ys, float * * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign * the X velocity to assign * the Y velocity to assign + * the Z velocity to assign * the acceleration to assign */ - public void update(float xp, float yp, float xs, float ys, float ma) + public void update(float xp, float yp, float zp, float xs, float ys, float zs, float ma) { - base.update(xp, yp); + base.update(xp, yp,zp); x_speed = xs; y_speed = ys; - motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); + z_speed = zs; + motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed + z_speed * z_speed); motion_accel = ma; if (motion_accel > 0) state = TUIO_ACCELERATING; @@ -271,7 +296,7 @@ public void update(float xp, float yp, float xs, float ys, float ma) else state = TUIO_STOPPED; lock (path) { - path.AddLast (new TuioPoint (currentTime, xpos, ypos)); + path.AddLast (new TuioPoint (currentTime, xpos, ypos,zpos)); if (path.Count > 128) path.RemoveFirst (); } } @@ -286,19 +311,18 @@ public void update(float xp, float yp, float xs, float ys, float ma) */ public void update(TuioContainer tcon) { - base.update(tcon.X, tcon.Y); + base.update(tcon.X, tcon.Y, tcon.Z); x_speed = tcon.XSpeed; y_speed = tcon.YSpeed; - motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); + z_speed = tcon.ZSpeed; + motion_speed = tcon.MotionSpeed; motion_accel = tcon.MotionAccel; - if (motion_accel > 0) state = TUIO_ACCELERATING; - else if (motion_accel < 0) state = TUIO_DECELERATING; - else state = TUIO_STOPPED; + state = tcon.state; lock (path) { - path.AddLast (new TuioPoint (currentTime, xpos, ypos)); + path.AddLast (new TuioPoint (currentTime, xpos, ypos,zpos)); if (path.Count > 128) path.RemoveFirst (); } } @@ -367,6 +391,22 @@ public float getYSpeed() return YSpeed; } + /** + * + * Returns the Z velocity of this TuioContainer. + * the Z velocity of this TuioContainer + */ + public float ZSpeed + { + get { return y_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property ZSpeed instead is recommended.")] + public float getZSpeed() + { + return ZSpeed; + } + /** * * Returns the position of this TuioContainer. @@ -374,7 +414,7 @@ public float getYSpeed() */ public TuioPoint Position { - get { return new TuioPoint(xpos, ypos); } + get { return new TuioPoint(xpos, ypos,zpos); } } [Obsolete("This method is provided only for compatability with legacy code. Use of the property Position instead is recommended.")] diff --git a/TUIO/TuioCursor.cs b/TUIO/TuioCursor.cs index 3ad25f5..4814f1e 100644 --- a/TUIO/TuioCursor.cs +++ b/TUIO/TuioCursor.cs @@ -51,7 +51,7 @@ public class TuioCursor : TuioContainer * the Y coordinate to assign */ public TuioCursor(TuioTime ttime, long si, int ci, float xp, float yp) - : base(ttime, si, xp, yp) + : base(ttime, si, xp, yp,0) { cursor_id = ci; } @@ -67,7 +67,7 @@ public TuioCursor(TuioTime ttime, long si, int ci, float xp, float yp) * the Y coordinate to assign */ public TuioCursor(long si, int ci, float xp, float yp) - : base(si, xp, yp) + : base(si, xp, yp,0) { cursor_id = ci; } @@ -86,6 +86,88 @@ public TuioCursor(TuioCursor tcur) } #endregion + + + #region Update Methods + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioObject attributes. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the X velocity to assign + * the Y velocity to assign + * the motion acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp, float xs, float ys, float ma) + { + base.update(ttime, xp, yp, 0, xs, ys, 0, ma); + } + + /** + * + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * the X coordinate to assign + * the Y coordinate to assign + * the X velocity to assign + * the Y velocity to assign + * the motion acceleration to assign + */ + public void update(float xp, float yp, float xs, float ys, float ma) + { + base.update(xp, yp, 0, xs, ys, 0, ma); + } + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioObject attributes. + * The speed and accleration values are calculated accordingly. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp) + { + TuioPoint lastPoint = path.Last.Value; + base.update(ttime, xp, yp, 0); + } + + /** + * + * Takes the atttibutes of the provided TuioCursor + * and assigs these values to this TuioCursor. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * the TuioContainer to assign + */ + public void update(TuioCursor tcur) + { + base.update(tcur); + state = tcur.state; + } + + /** + * + * This method is used to calculate the speed and acceleration values of a + * TuioCursor. + */ + public new void stop(TuioTime ttime) + { + update(ttime, this.xpos, this.ypos); + } + #endregion + + + #region Properties & Getter/Setter Methods /** diff --git a/TUIO/TuioCursor25D.cs b/TUIO/TuioCursor25D.cs new file mode 100644 index 0000000..321256c --- /dev/null +++ b/TUIO/TuioCursor25D.cs @@ -0,0 +1,113 @@ +/* + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2005-2016 Martin Kaltenbrunner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. +*/ + +using System; + +namespace TUIO +{ + + /** + * + * The TuioCursor25D class encapsulates /tuio/25Dcur TUIO cursors. + * + * @authorNicolas Bremard + * @version 1.1.7 + */ + public class TuioCursor25D : TuioContainer + { + + /** + * + * The individual cursor ID number that is assigned to each TuioCursor25D. + */ + protected int cursor_id; + + #region Constructors + + /** + * + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor25D. + * + * the TuioTime to assign + * the Session ID to assign + * the Cursor ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + */ + public TuioCursor25D(TuioTime ttime, long si, int ci, float xp, float yp, float zp) + : base(ttime, si, xp, yp,zp) + { + cursor_id = ci; + } + + /** + * + * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + * and assigs these values to the newly created TuioCursor25D. + * + * the Session ID to assign + * the Cursor ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + */ + public TuioCursor25D(long si, int ci, float xp, float yp, float zp) + : base(si, xp, yp,zp) + { + cursor_id = ci; + } + + /** + * + * This constructor takes the atttibutes of the provided TuioCursor25D + * and assigs these values to the newly created TuioCursor25D. + * + * the TuioCursor25D to assign + */ + public TuioCursor25D(TuioCursor25D tcur) + : base(tcur) + { + cursor_id = tcur.CursorID; + } + #endregion + + + + #region Properties & Getter/Setter Methods + + /** + * + * Returns the Cursor ID of this TuioCursor25D. + * the Cursor ID of this TuioCursor25D + */ + public int CursorID + { + get { return cursor_id; } + } + + [Obsolete("This method has been depracated and is provided only for compatability with legacy code. The CursorID property should be used instead.")] + public int getCursorID() + { + return cursor_id; + } + #endregion + + } +} diff --git a/TUIO/TuioCursor3D.cs b/TUIO/TuioCursor3D.cs new file mode 100644 index 0000000..c8b647c --- /dev/null +++ b/TUIO/TuioCursor3D.cs @@ -0,0 +1,113 @@ +/* + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2005-2016 Martin Kaltenbrunner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. +*/ + +using System; + +namespace TUIO +{ + + /** + * + * The TuioCursor3D class encapsulates /tuio/3Dcur TUIO cursors. + * + * @authorNicolas Bremard + * @version 1.1.7 + */ + public class TuioCursor3D : TuioContainer + { + + /** + * + * The individual cursor ID number that is assigned to each TuioCursor3D. + */ + protected int cursor_id; + + #region Constructors + + /** + * + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor3D. + * + * the TuioTime to assign + * the Session ID to assign + * the Cursor ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + */ + public TuioCursor3D(TuioTime ttime, long si, int ci, float xp, float yp, float zp) + : base(ttime, si, xp, yp,zp) + { + cursor_id = ci; + } + + /** + * + * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + * and assigs these values to the newly created TuioCursor3D. + * + * the Session ID to assign + * the Cursor ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + */ + public TuioCursor3D(long si, int ci, float xp, float yp, float zp) + : base(si, xp, yp,zp) + { + cursor_id = ci; + } + + /** + * + * This constructor takes the atttibutes of the provided TuioCursor3D + * and assigs these values to the newly created TuioCursor3D. + * + * the TuioCursor3D to assign + */ + public TuioCursor3D(TuioCursor3D tcur) + : base(tcur) + { + cursor_id = tcur.CursorID; + } + #endregion + + + + #region Properties & Getter/Setter Methods + + /** + * + * Returns the Cursor ID of this TuioCursor3D. + * the Cursor ID of this TuioCursor3D + */ + public int CursorID + { + get { return cursor_id; } + } + + [Obsolete("This method has been depracated and is provided only for compatability with legacy code. The CursorID property should be used instead.")] + public int getCursorID() + { + return cursor_id; + } + #endregion + + } +} diff --git a/TUIO/TuioListener.cs b/TUIO/TuioListener.cs index 5772c9b..260624b 100644 --- a/TUIO/TuioListener.cs +++ b/TUIO/TuioListener.cs @@ -1,6 +1,6 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -41,8 +41,8 @@ namespace TUIO * * * - * @author Martin Kaltenbrunner - * @version 1.1.6 + * @author Nicolas Bremard + * @version 1.1.7 */ public interface TuioListener { @@ -118,6 +118,166 @@ public interface TuioListener */ void removeTuioBlob(TuioBlob tblb); + + + + /** + * + * This callback method is invoked by the TuioClient when a new TuioObject25D is added to the session. + * + * the TuioObject25D reference associated to the addTuioObject25D event + */ + void addTuioObject25D(TuioObject25D tobj); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioObject25D is updated during the session. + * + * the TuioObject25D reference associated to the updateTuioObject25D event + */ + void updateTuioObject25D(TuioObject25D tobj); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioObject25D is removed from the session. + * + * the TuioObject25D reference associated to the removeTuioObject25D event + */ + void removeTuioObject25D(TuioObject25D tobj); + + /** + * + * This callback method is invoked by the TuioClient when a new TuioCursor25D is added to the session. + * + * the TuioCursor25D reference associated to the addTuioCursor25D event + */ + void addTuioCursor25D(TuioCursor25D tcur); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioCursor25D is updated during the session. + * + * the TuioCursor25D reference associated to the updateTuioCursor25D event + */ + void updateTuioCursor25D(TuioCursor25D tcur); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioCursor25D is removed from the session. + * + * the TuioCursor25D reference associated to the removeTuioCursor25D event + */ + void removeTuioCursor25D(TuioCursor25D tcur); + + /** + * + * This callback method is invoked by the TuioClient when a new TuioBlob25D is added to the session. + * + * the TuioBlob25D reference associated to the addTuioBlob25D event + */ + void addTuioBlob25D(TuioBlob25D tblb); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioBlob25D is updated during the session. + * + * the TuioBlob25D reference associated to the updateTuioBlob25D event + */ + void updateTuioBlob25D(TuioBlob25D tblb); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioBlob25D is removed from the session. + * + * the TuioBlob25D reference associated to the removeTuioBlob25D event + */ + void removeTuioBlob25D(TuioBlob25D tblb); + + + + + + + /** + * + * This callback method is invoked by the TuioClient when a new TuioObject3D is added to the session. + * + * the TuioObject3D reference associated to the addTuioObject3D event + */ + void addTuioObject3D(TuioObject3D tobj); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioObject3D is updated during the session. + * + * the TuioObject3D reference associated to the updateTuioObject3D event + */ + void updateTuioObject3D(TuioObject3D tobj); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioObject3D is removed from the session. + * + * the TuioObject3D reference associated to the removeTuioObject3D event + */ + void removeTuioObject3D(TuioObject3D tobj); + + /** + * + * This callback method is invoked by the TuioClient when a new TuioCursor3D is added to the session. + * + * the TuioCursor3D reference associated to the addTuioCursor3D event + */ + void addTuioCursor3D(TuioCursor3D tcur); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioCursor3D is updated during the session. + * + * the TuioCursor3D reference associated to the updateTuioCursor3D event + */ + void updateTuioCursor3D(TuioCursor3D tcur); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioCursor3D is removed from the session. + * + * the TuioCursor3D reference associated to the removeTuioCursor3D event + */ + void removeTuioCursor3D(TuioCursor3D tcur); + + /** + * + * This callback method is invoked by the TuioClient when a new TuioBlob3D is added to the session. + * + * the TuioBlob3D reference associated to the addTuioBlob3D event + */ + void addTuioBlob3D(TuioBlob3D tblb); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioBlob3D is updated during the session. + * + * the TuioBlob3D reference associated to the updateTuioBlob3D event + */ + void updateTuioBlob3D(TuioBlob3D tblb); + + /** + * + * This callback method is invoked by the TuioClient when an existing TuioBlob3D is removed from the session. + * + * the TuioBlob3D reference associated to the removeTuioBlob3D event + */ + void removeTuioBlob3D(TuioBlob3D tblb); + + + + + + + + + /** * * This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. diff --git a/TUIO/TuioObject.cs b/TUIO/TuioObject.cs index eb37d43..d3f8886 100644 --- a/TUIO/TuioObject.cs +++ b/TUIO/TuioObject.cs @@ -62,7 +62,7 @@ public class TuioObject : TuioContainer * * Defines the ROTATING state. */ - public static readonly int TUIO_ROTATING = 5; + public static readonly int TUIO_ROTATING = 4; #endregion #region Constructors @@ -80,7 +80,7 @@ public class TuioObject : TuioContainer * the angle to assign */ public TuioObject(TuioTime ttime, long si, int sym, float xp, float yp, float a) - : base(ttime, si, xp, yp) + : base(ttime, si, xp, yp,0) { symbol_id = sym; angle = a; @@ -100,7 +100,7 @@ public TuioObject(TuioTime ttime, long si, int sym, float xp, float yp, float a) * the angle to assign */ public TuioObject(long si, int sym, float xp, float yp, float a) - : base(si, xp, yp) + : base(si, xp, yp, 0) { symbol_id = sym; angle = a; @@ -145,7 +145,7 @@ public TuioObject(TuioObject tobj) */ public void update(TuioTime ttime, float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { - base.update(ttime, xp, yp, xs, ys, ma); + base.update(ttime, xp, yp,0, xs, ys,0, ma); angle = a; rotation_speed = rs; rotation_accel = ra; @@ -169,7 +169,7 @@ public void update(TuioTime ttime, float xp, float yp, float a, float xs, float */ public void update(float xp, float yp, float a, float xs, float ys, float rs, float ma, float ra) { - base.update(xp, yp, xs, ys, ma); + base.update(xp, yp, 0, xs, ys, 0, ma); angle = a; rotation_speed = rs; rotation_accel = ra; @@ -187,10 +187,10 @@ public void update(float xp, float yp, float a, float xs, float ys, float rs, fl * the Y coordinate to assign * the angle coordinate to assign */ - public void update(TuioTime ttime, float xp, float yp, float a) + public new void update(TuioTime ttime, float xp, float yp, float a) { TuioPoint lastPoint = path.Last.Value; - base.update(ttime, xp, yp); + base.update(ttime, xp, yp, 0); TuioTime diffTime = currentTime - lastPoint.TuioTime; float dt = diffTime.TotalMilliseconds / 1000.0f; @@ -221,7 +221,7 @@ public void update(TuioObject tobj) angle = tobj.Angle; rotation_speed = tobj.RotationSpeed; rotation_accel = tobj.RotationAccel; - if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + state = tobj.state; } /** diff --git a/TUIO/TuioObject25D.cs b/TUIO/TuioObject25D.cs new file mode 100644 index 0000000..95f8e18 --- /dev/null +++ b/TUIO/TuioObject25D.cs @@ -0,0 +1,343 @@ +/* + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2005-2016 Martin Kaltenbrunner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. +*/ + +using System; +using System.Collections.Generic; + +namespace TUIO +{ + + /** + * + * The TuioObject class encapsulates /tuio/25Dobj TUIO objects. + * + * + * @author Nicolas Bremard + * @version 1.1.7 + */ + public class TuioObject25D : TuioContainer + { + /** + * + * The individual symbol ID number that is assigned to each TuioObject. + */ + protected int symbol_id; + + /** + * + * The rotation angle value. + */ + protected float angle; + + /** + * + * The rotation speed value. + */ + protected float rotation_speed; + + /** + * + * The rotation acceleration value. + */ + protected float rotation_accel; + + #region State Enumeration Values + + /** + * + * Defines the ROTATING state. + */ + public static readonly int TUIO_ROTATING = 4; + #endregion + + #region Constructors + + /** + * + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject25D. + * + * the TuioTime to assign + * the Session ID to assign + * the Symbol ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle to assign + */ + public TuioObject25D(TuioTime ttime, long si, int sym, float xp, float yp, float zp, float a) + : base(ttime, si, xp, yp,zp) + { + symbol_id = sym; + angle = a; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * + * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + * and angle, and assigs these values to the newly created TuioObject25D. + * + * the Session ID to assign + * the Symbol ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle to assign + */ + public TuioObject25D(long si, int sym, float xp, float yp, float zp, float a) + : base(si, xp, yp, zp) + { + symbol_id = sym; + angle = a; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * + * This constructor takes the atttibutes of the provided TuioObject25D + * and assigs these values to the newly created TuioObject25D. + * + * the TuioObject25D to assign + */ + public TuioObject25D(TuioObject25D tobj) + : base(tobj) + { + symbol_id = tobj.SymbolID; + angle = tobj.Angle; + rotation_speed = 0.0f; + rotation_accel = 0.0f; + } + #endregion + + #region Update Methods + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioObject25D attributes. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + * the X velocity to assign + * the Y velocity to assign + * the Z velocity to assign + * the rotation velocity to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float a, float xs, float ys, float zs, float rs, float ma, float ra) + { + base.update(ttime, xp, yp,zp, xs, ys,zs, ma); + angle = a; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + * the X velocity to assign + * the Y velocity to assign + * the Z velocity to assign + * the rotation velocity to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(float xp, float yp, float zp, float a, float xs, float ys, float zs, float rs, float ma, float ra) + { + base.update(xp, yp, zp, xs, ys, zs, ma); + angle = a; + rotation_speed = rs; + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioObject25D attributes. + * The speed and accleration values are calculated accordingly. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float a) + { + TuioPoint lastPoint = path.Last.Value; + base.update(ttime, xp, yp, zp); + + TuioTime diffTime = currentTime - lastPoint.TuioTime; + float dt = diffTime.TotalMilliseconds / 1000.0f; + float last_angle = angle; + float last_rotation_speed = rotation_speed; + angle = a; + + float da = (angle - last_angle) / (2.0f * (float)Math.PI); + if (da > 0.75f) da -= 1.0f; + else if (da < -0.75f) da += 1.0f; + + rotation_speed = da / dt; + rotation_accel = (rotation_speed - last_rotation_speed) / dt; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * + * Takes the atttibutes of the provided TuioObject25D + * and assigs these values to this TuioObject25D. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * the TuioContainer to assign + */ + public void update(TuioObject25D tobj) + { + base.update(tobj); + angle = tobj.Angle; + rotation_speed = tobj.RotationSpeed; + rotation_accel = tobj.RotationAccel; + state = tobj.state; + } + + /** + * + * This method is used to calculate the speed and acceleration values of a + * TuioObject25D with unchanged position and angle. + */ + public new void stop(TuioTime ttime) + { + update(ttime, this.xpos, this.ypos, this.angle); + } + #endregion + + #region Properties & Getter/Setter Methods + + /** + * + * Returns the symbol ID of this TuioObject25D. + * the symbol ID of this TuioObject25D + */ + public int SymbolID + { + get { return symbol_id; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public int getSymbolID() + { + return SymbolID; + } + + /** + * + * Returns the rotation angle of this TuioObject25D. + * the rotation angle of this TuioObject25D + */ + public float Angle + { + get { return angle; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getAngle() + { + return Angle; + } + + /** + * + * Returns the rotation angle in degrees of this TuioObject25D. + * the rotation angle in degrees of this TuioObject25D + */ + public float AngleDegrees + { + get { return angle / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getAngleDegrees() + { + return AngleDegrees; + } + + /** + * + * Returns the rotation speed of this TuioObject25D. + * the rotation speed of this TuioObject25D + */ + public float RotationSpeed + { + get { return rotation_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRotationSpeed() + { + return RotationSpeed; + } + + /** + * + * Returns the rotation acceleration of this TuioObject25D. + * the rotation acceleration of this TuioObject25D + */ + public float RotationAccel + { + get { return rotation_accel; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRotationAccel() + { + return RotationAccel; + } + + /** + * + * Returns true of this TuioObject25D is moving. + * true of this TuioObject25D is moving + */ + public override bool isMoving + { + get + { + if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING) || (state == TUIO_ROTATING)) return true; + else return false; + } + } + #endregion + } + +} diff --git a/TUIO/TuioObject3D.cs b/TUIO/TuioObject3D.cs new file mode 100644 index 0000000..87dcdb7 --- /dev/null +++ b/TUIO/TuioObject3D.cs @@ -0,0 +1,558 @@ +/* + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2005-2016 Martin Kaltenbrunner + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3.0 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. +*/ + +using System; +using System.Collections.Generic; + +namespace TUIO +{ + + /** + * + * The TuioObject class encapsulates /tuio/3Dobj TUIO objects. + * + * + * @author Nicolas Bremard + * @version 1.1.7 + */ + public class TuioObject3D : TuioContainer + { + /** + * + * The individual symbol ID number that is assigned to each TuioObject. + */ + protected int symbol_id; + + /** + * + * The roll angle value. + */ + protected float roll; + + /** + * + * The roll speed value. + */ + protected float roll_speed; + + /** + * + * The pitch angle value. + */ + protected float pitch; + + /** + * + * The pitch speed value. + */ + protected float pitch_speed; + + + + /** + * + * The yaw angle value. + */ + protected float yaw; + + /** + * + * The yaw speed value. + */ + protected float yaw_speed; + + + /** + * + * The rotation acceleration value. + */ + protected float rotation_accel; + + #region State Enumeration Values + + /** + * + * Defines the ROTATING state. + */ + public static readonly int TUIO_ROTATING = 4; + #endregion + + #region Constructors + + /** + * + * This constructor takes a TuioTime argument and assigns it along with the provided + * Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject3D. + * + * the TuioTime to assign + * the Session ID to assign + * the Symbol ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + */ + public TuioObject3D(TuioTime ttime, long si, int sym, float xp, float yp, float zp, float ro, float po, float yo) + : base(ttime, si, xp, yp,zp) + { + symbol_id = sym; + roll = ro; + pitch = po; + yaw = yo; + roll_speed = 0.0f; + pitch_speed = 0.0f; + yaw_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * + * This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + * and angle, and assigs these values to the newly created TuioObject3D. + * + * the Session ID to assign + * the Symbol ID to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + */ + public TuioObject3D(long si, int sym, float xp, float yp, float zp, float ro, float po, float yo) + : base(si, xp, yp, zp) + { + symbol_id = sym; + roll = ro; + pitch = po; + yaw = yo; + roll_speed = 0.0f; + pitch_speed = 0.0f; + yaw_speed = 0.0f; + rotation_accel = 0.0f; + } + + /** + * + * This constructor takes the atttibutes of the provided TuioObject3D + * and assigs these values to the newly created TuioObject3D. + * + * the TuioObject3D to assign + */ + public TuioObject3D(TuioObject3D tobj) + : base(tobj) + { + symbol_id = tobj.SymbolID; + + roll = tobj.Roll; + pitch = tobj.Pitch; + yaw = tobj.Yaw; + roll_speed = tobj.RollSpeed; + pitch_speed = tobj.PitchSpeed; + yaw_speed = tobj.YawSpeed; + rotation_accel = tobj.RotationAccel; + } + #endregion + + #region Update Methods + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate, angle, X and Y velocity, motion acceleration, + * rotation speed and rotation acceleration to the private TuioObject3D attributes. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the X velocity to assign + * the Y velocity to assign + * the Z velocity to assign + * the roll speed to assign + * the pitch speed to assign + * the yaw speed to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float ro, float po, float yo, float xs, float ys, float zs, float ros, float pos, float yos, float ma, float ra) + { + base.update(ttime, xp, yp,zp, xs, ys,zs, ma); + roll = ro; + pitch = po; + yaw = yo; + roll_speed = ros; + yaw_speed = pos; + pitch_speed = yos; + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * + * Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + * rotation velocity and rotation acceleration to the private TuioContainer attributes. + * The TuioTime time stamp remains unchanged. + * + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the roll to assign + * the pitch to assign + * the yaw to assign + * the X velocity to assign + * the Y velocity to assign + * the Z velocity to assign + * the roll speed to assign + * the pitch speed to assign + * the yaw speed to assign + * the motion acceleration to assign + * the rotation acceleration to assign + */ + public void update(float xp, float yp, float zp, float ro, float po, float yo, float xs, float ys, float zs, float ros, float pos, float yos, float ma, float ra) + { + base.update(xp, yp, zp, xs, ys, zs, ma); + roll = ro; + pitch = po; + yaw = yo; + roll_speed = ros; + yaw_speed = pos; + pitch_speed = yos; + rotation_accel = ra; + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate and angle to the private TuioObject3D attributes. + * The speed and accleration values are calculated accordingly. + * + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + * the angle coordinate to assign + */ + public void update(TuioTime ttime, float xp, float yp, float zp, float ro, float po, float yo) + { + TuioPoint lastPoint = path.Last.Value; + base.update(ttime, xp, yp, zp); + + TuioTime diffTime = currentTime - lastPoint.TuioTime; + float dt = diffTime.TotalMilliseconds / 1000.0f; + + + float last_roll = roll; + roll = ro; + + float dro = (roll - last_roll) / (2.0f * (float)Math.PI); + if (dro > 0.75f) dro -= 1.0f; + else if (dro < -0.75f) dro += 1.0f; + + float last_roll_speed = roll_speed; + roll_speed = dro / dt; + float roll_accel = (yaw_speed - last_roll_speed) / dt; + + + float last_pitch = pitch; + pitch = po; + + float dpo = (pitch - last_pitch) / (2.0f * (float)Math.PI); + if (dpo > 0.75f) dpo -= 1.0f; + else if (dpo < -0.75f) dpo += 1.0f; + + float last_pitch_speed = pitch_speed; + pitch_speed = dpo / dt; + float pitch_accel = (pitch_speed - last_pitch_speed) / dt; + + + float last_yaw = yaw; + yaw = yo; + + float dyo = (yaw - last_yaw) / (2.0f * (float)Math.PI); + if (dyo > 0.75f) dyo -= 1.0f; + else if (dyo < -0.75f) dyo += 1.0f; + + float last_yaw_speed = yaw_speed; + yaw_speed = dyo / dt; + float yaw_accel = (yaw_speed - last_yaw_speed) / dt; + + + rotation_accel = (roll_accel + pitch_accel + yaw_accel) / 3; + + + if ((rotation_accel != 0) && (state != TUIO_STOPPED)) state = TUIO_ROTATING; + } + + /** + * + * Takes the atttibutes of the provided TuioObject3D + * and assigs these values to this TuioObject3D. + * The TuioTime time stamp of this TuioContainer remains unchanged. + * + * the TuioContainer to assign + */ + public void update(TuioObject3D tobj) + { + base.update(tobj); + roll = tobj.Roll; + pitch = tobj.Pitch; + yaw = tobj.Yaw; + roll_speed = tobj.RollSpeed; + pitch_speed = tobj.PitchSpeed; + yaw_speed = tobj.YawSpeed; + rotation_accel = tobj.RotationAccel; + state = tobj.state; + } + + /** + * + * This method is used to calculate the speed and acceleration values of a + * TuioObject3D with unchanged position and angle. + */ + public new void stop(TuioTime ttime) + { + update(ttime, this.xpos, this.ypos, this.zpos); + } + #endregion + + #region Properties & Getter/Setter Methods + + /** + * + * Returns the symbol ID of this TuioObject3D. + * the symbol ID of this TuioObject3D + */ + public int SymbolID + { + get { return symbol_id; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public int getSymbolID() + { + return SymbolID; + } + + + + + /** + * + * Returns the rotation roll of this TuioObject3D. + * the rotation roll of this TuioObject3D + */ + public float Roll + { + get { return roll; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRoll() + { + return Roll; + } + + /** + * + * Returns the rotation roll in degrees of this TuioObject3D. + * the rotation roll in degrees of this TuioObject3D + */ + public float RollDegrees + { + get { return roll / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRollDegrees() + { + return RollDegrees; + } + + + + + + /** + * + * Returns the rotation pitch of this TuioObject3D. + * the rotation pitch of this TuioObject3D + */ + public float Pitch + { + get { return pitch; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getPitch() + { + return Pitch; + } + + /** + * + * Returns the rotation pitch in degrees of this TuioObject3D. + * the rotation pitch in degrees of this TuioObject3D + */ + public float PitchDegrees + { + get { return pitch / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getPitchDegrees() + { + return PitchDegrees; + } + + + + + + + + /** + * + * Returns the rotation yaw of this TuioObject3D. + * the rotation yaw of this TuioObject3D + */ + public float Yaw + { + get { return yaw; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getYaw() + { + return Yaw; + } + + /** + * + * Returns the rotation yaw in degrees of this TuioObject3D. + * the rotation yaw in degrees of this TuioObject3D + */ + public float YawDegrees + { + get { return yaw / (float)Math.PI * 180.0f; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getYawDegrees() + { + return YawDegrees; + } + + + + + + + /** + * + * Returns the roll speed of this TuioObject3D. + * the roll speed of this TuioObject3D + */ + public float RollSpeed + { + get { return roll_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRollSpeed() + { + return RollSpeed; + } + + + + /** + * + * Returns the pitch speed of this TuioObject3D. + * the pitch speed of this TuioObject3D + */ + public float PitchSpeed + { + get { return pitch_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getPitchSpeed() + { + return PitchSpeed; + } + + + + /** + * + * Returns the yaw speed of this TuioObject3D. + * the yaw speed of this TuioObject3D + */ + public float YawSpeed + { + get { return yaw_speed; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getYawSpeed() + { + return YawSpeed; + } + + + + /** + * + * Returns the rotation acceleration of this TuioObject3D. + * the rotation acceleration of this TuioObject3D + */ + public float RotationAccel + { + get { return rotation_accel; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getRotationAccel() + { + return RotationAccel; + } + + /** + * + * Returns true of this TuioObject3D is moving. + * true of this TuioObject3D is moving + */ + public override bool isMoving + { + get + { + if ((state == TUIO_ACCELERATING) || (state == TUIO_DECELERATING) || (state == TUIO_ROTATING)) return true; + else return false; + } + } + #endregion + } + +} diff --git a/TUIO/TuioPoint.cs b/TUIO/TuioPoint.cs index 74bd710..26c84fc 100644 --- a/TUIO/TuioPoint.cs +++ b/TUIO/TuioPoint.cs @@ -44,6 +44,12 @@ public class TuioPoint */ protected float ypos; + /** + * + * Z coordinate, representated as a floating point value in a range of 0..1 + */ + protected float zpos; + /** * * The time stamp of the last update represented as TuioTime (time since session start) @@ -69,6 +75,7 @@ public TuioPoint() { xpos = 0.0f; ypos = 0.0f; + zpos = 0.0f; currentTime = TuioTime.SessionTime; startTime = new TuioTime(currentTime); } @@ -80,11 +87,13 @@ public TuioPoint() * * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public TuioPoint(float xp, float yp) + public TuioPoint(float xp, float yp, float zp) { xpos = xp; ypos = yp; + zpos = zp; currentTime = TuioTime.SessionTime; startTime = new TuioTime(currentTime); } @@ -100,6 +109,7 @@ public TuioPoint(TuioPoint tpoint) { xpos = tpoint.X; ypos = tpoint.Y; + zpos = tpoint.Z; currentTime = TuioTime.SessionTime; startTime = new TuioTime(currentTime); } @@ -112,11 +122,13 @@ public TuioPoint(TuioPoint tpoint) * the TuioTime to assign * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public TuioPoint(TuioTime ttime, float xp, float yp) + public TuioPoint(TuioTime ttime, float xp, float yp, float zp) { xpos = xp; ypos = yp; + zpos = zp; currentTime = new TuioTime(ttime); startTime = new TuioTime(currentTime); } @@ -136,6 +148,7 @@ public void update(TuioPoint tpoint) { xpos = tpoint.X; ypos = tpoint.Y; + zpos = tpoint.Z; } /** @@ -145,11 +158,13 @@ public void update(TuioPoint tpoint) * * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public void update(float xp, float yp) + public void update(float xp, float yp, float zp) { xpos = xp; ypos = yp; + zpos = zp; } /** @@ -160,11 +175,13 @@ public void update(float xp, float yp) * the TuioTime to assign * the X coordinate to assign * the Y coordinate to assign + * the Z coordinate to assign */ - public void update(TuioTime ttime, float xp, float yp) + public void update(TuioTime ttime, float xp, float yp, float zp) { xpos = xp; ypos = yp; + zpos = zp; currentTime = new TuioTime(ttime); } @@ -204,6 +221,22 @@ public float getY() return Y; } + /** + * + * Returns the Z coordinate of this TuioPoint. + * the Z coordinate of this TuioPoint + */ + public float Z + { + get { return zpos; } + } + + [Obsolete("This method is provided only for compatability with legacy code. Use of the property instead is recommended.")] + public float getZ() + { + return Z; + } + /** * * Returns the distance to the provided coordinates @@ -219,6 +252,24 @@ public float getDistance(float xp, float yp) return (float)Math.Sqrt(dx * dx + dy * dy); } + + /** + * + * Returns the distance to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the Z coordinate of the distant point + * the distance to the provided coordinates + */ + public float getDistance(float xp, float yp, float zp) + { + float dx = xpos - xp; + float dy = ypos - yp; + float dz = zpos - zp; + return (float)Math.Sqrt(dx * dx + dy * dy + dz * dz); + } + /** * * Returns the distance to the provided TuioPoint @@ -228,9 +279,29 @@ public float getDistance(float xp, float yp) */ public float getDistance(TuioPoint tpoint) { - return getDistance(tpoint.X, tpoint.Y); + return getDistance(tpoint.X, tpoint.Y, tpoint.Z); } + + /** + * + * Returns the distance to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the Z coordinate of the distant point + * the distance to the provided coordinates + */ + public float getSpaceDistance(float xp, float yp, float zp, int w, int h, int d) + { + float dx = w * xpos - w * xp; + float dy = h * ypos - h * yp; + float dz = d * zpos - d * zp; + return (float) Math.Sqrt(dx* dx + dy* dy + dz* dz); + } + + + /** * * Returns the angle to the provided coordinates @@ -289,6 +360,172 @@ public float getAngleDegrees(TuioPoint tpoint) return (getAngle(tpoint) / (float)Math.PI) * 180.0f; } + + + + + /** + * + * Returns the angle to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the angle to the provided coordinates + */ + public float getRollAngle(float xp, float yp, float zp) + { + return getAngle(xp,yp); + } + + /** + * + * Returns the angle to the provided TuioPoint + * + * the distant TuioPoint + * the angle to the provided TuioPoint + */ + public float getRollAngle(TuioPoint tpoint) + { + return getAngle(tpoint.X, tpoint.Y); + } + + /** + * + * Returns the angle in degrees to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the angle in degrees to the provided TuioPoint + */ + public float getRollAngleDegrees(float xp, float yp, float zp) + { + return (getAngle(xp, yp) / (float)Math.PI) * 180.0f; + } + + /** + * + * Returns the angle in degrees to the provided TuioPoint + * + * the distant TuioPoint + * the angle in degrees to the provided TuioPoint + */ + public float getRollAngleDegrees(TuioPoint tpoint) + { + return (getRollAngle(tpoint) / (float)Math.PI) * 180.0f; + } + + + + + /** + * + * Returns the angle to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the angle to the provided coordinates + */ + public float getPitchAngle(float xp, float yp, float zp) + { + return getAngle(zp, yp); + } + + /** + * + * Returns the angle to the provided TuioPoint + * + * the distant TuioPoint + * the angle to the provided TuioPoint + */ + public float getPitchAngle(TuioPoint tpoint) + { + return getAngle(tpoint.Z, tpoint.Y); + } + + /** + * + * Returns the angle in degrees to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the angle in degrees to the provided TuioPoint + */ + public float getPitchAngleDegrees(float xp, float yp, float zp) + { + return (getAngle(zp, yp) / (float)Math.PI) * 180.0f; + } + + /** + * + * Returns the angle in degrees to the provided TuioPoint + * + * the distant TuioPoint + * the angle in degrees to the provided TuioPoint + */ + public float getPitchAngleDegrees(TuioPoint tpoint) + { + return (getPitchAngle(tpoint) / (float)Math.PI) * 180.0f; + } + + + + + /** + * + * Returns the angle to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the angle to the provided coordinates + */ + public float getYawAngle(float xp, float yp, float zp) + { + return getAngle(xp, zp); + } + + /** + * + * Returns the angle to the provided TuioPoint + * + * the distant TuioPoint + * the angle to the provided TuioPoint + */ + public float getYawAngle(TuioPoint tpoint) + { + return getAngle(tpoint.X, tpoint.Z); + } + + /** + * + * Returns the angle in degrees to the provided coordinates + * + * the X coordinate of the distant point + * the Y coordinate of the distant point + * the angle in degrees to the provided TuioPoint + */ + public float getYawAngleDegrees(float xp, float yp, float zp) + { + return (getAngle(xp, zp) / (float)Math.PI) * 180.0f; + } + + /** + * + * Returns the angle in degrees to the provided TuioPoint + * + * the distant TuioPoint + * the angle in degrees to the provided TuioPoint + */ + public float getYawAngleDegrees(TuioPoint tpoint) + { + return (getYawAngle(tpoint) / (float)Math.PI) * 180.0f; + } + + + + + + + /** * * Returns the X coordinate in pixels relative to the provided screen width. @@ -313,6 +550,44 @@ public int getScreenY(int height) return (int)Math.Round(ypos * height); } + + /** + * + * Returns the Y coordinate in pixels relative to the provided screen height. + * + * the screen height + * the Y coordinate of this TuioPoint in pixels relative to the provided screen height + */ + public int getSpaceX(int width) + { + return (int)Math.Round(xpos * width); + } + + /** + * + * Returns the Y coordinate in pixels relative to the provided screen height. + * + * the screen height + * the Y coordinate of this TuioPoint in pixels relative to the provided screen height + */ + public int getSpaceY(int height) + { + return (int)Math.Round(ypos * height); + } + + /** + * + * Returns the Y coordinate in pixels relative to the provided screen height. + * + * the screen height + * the Y coordinate of this TuioPoint in pixels relative to the provided screen height + */ + public int getSpaceZ(int depth) + { + return (int)Math.Round(zpos * depth); + } + + /** * * Returns the time stamp of this TuioPoint as TuioTime. diff --git a/TUIO_DEMO.csproj b/TUIO_DEMO.csproj index 5f41867..097d123 100644 --- a/TUIO_DEMO.csproj +++ b/TUIO_DEMO.csproj @@ -28,7 +28,8 @@ false - + + true bin\Release\ TRACE @@ -56,11 +57,17 @@ Form + + + + + + diff --git a/TUIO_DUMP.csproj b/TUIO_DUMP.csproj index 59fdfa9..d8247eb 100644 --- a/TUIO_DUMP.csproj +++ b/TUIO_DUMP.csproj @@ -51,11 +51,17 @@ + + + + + + diff --git a/TUIO_LIB.csproj b/TUIO_LIB.csproj index 8de16ed..41ee22a 100644 --- a/TUIO_LIB.csproj +++ b/TUIO_LIB.csproj @@ -44,11 +44,17 @@ + + + + + + diff --git a/TuioDemo.cs b/TuioDemo.cs index 148f9bd..1f95ff9 100644 --- a/TuioDemo.cs +++ b/TuioDemo.cs @@ -1,6 +1,6 @@ /* TUIO C# Demo - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,8 +32,14 @@ public class TuioDemo : Form , TuioListener private Dictionary objectList; private Dictionary cursorList; private Dictionary blobList; - - public static int width, height; + private Dictionary object25DList; + private Dictionary cursor25DList; + private Dictionary blob25DList; + private Dictionary object3DList; + private Dictionary cursor3DList; + private Dictionary blob3DList; + + public static int width, height; private int window_width = 640; private int window_height = 480; private int window_left = 0; @@ -73,8 +79,16 @@ public TuioDemo(int port) { objectList = new Dictionary(128); cursorList = new Dictionary(128); blobList = new Dictionary(128); - - client = new TuioClient(port); + + object25DList = new Dictionary(128); + cursor25DList = new Dictionary(128); + blob25DList = new Dictionary(128); + + object3DList = new Dictionary(128); + cursor3DList = new Dictionary(128); + blob3DList = new Dictionary(128); + + client = new TuioClient(port); client.addTuioListener(this); client.connect(); @@ -131,7 +145,8 @@ private void Form_Closing(object sender, System.ComponentModel.CancelEventArgs e public void addTuioObject(TuioObject o) { lock(objectList) { objectList.Add(o.SessionID,o); - } if (verbose) Console.WriteLine("add obj "+o.SymbolID+" ("+o.SessionID+") "+o.X+" "+o.Y+" "+o.Angle); + } + if (verbose) Console.WriteLine("add obj "+o.SymbolID+" ("+o.SessionID+") "+o.X+" "+o.Y+" "+o.Angle); } public void updateTuioObject(TuioObject o) { @@ -183,7 +198,178 @@ public void removeTuioBlob(TuioBlob b) { if (verbose) Console.WriteLine("del blb "+b.BlobID + " ("+b.SessionID+")"); } - public void refresh(TuioTime frameTime) { + + + + + + + + public void addTuioObject25D(TuioObject25D tobj) + { + lock (object25DList) + { + object25DList.Add(tobj.SessionID, tobj); + } + if(verbose) + Console.WriteLine("add 25Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Angle); + } + + public void updateTuioObject25D(TuioObject25D tobj) + { + if (verbose) + Console.WriteLine("set 25Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Angle + " " + tobj.XSpeed + " " + tobj.YSpeed + " " + tobj.ZSpeed + " " + tobj.RotationSpeed + " " + tobj.MotionAccel + " " + tobj.RotationAccel); + } + + public void removeTuioObject25D(TuioObject25D tobj) + { + lock (object25DList) + { + object25DList.Remove(tobj.SessionID); + } + if (verbose) + Console.WriteLine("del 25Dobj " + tobj.SessionID + " " + tobj.SymbolID); + } + + public void addTuioCursor25D(TuioCursor25D tcur) + { + lock (cursor25DList) + { + cursor25DList.Add(tcur.SessionID, tcur); + } + if (verbose) + Console.WriteLine("add 25Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z); + } + + public void updateTuioCursor25D(TuioCursor25D tcur) + { + if (verbose) + Console.WriteLine("set 25Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z + " " + tcur.XSpeed + " " + tcur.YSpeed + " " + tcur.ZSpeed + " " + tcur.MotionAccel); + } + + public void removeTuioCursor25D(TuioCursor25D tcur) + { + lock (cursor25DList) + { + cursor25DList.Remove(tcur.SessionID); + } + if (verbose) + Console.WriteLine("del 25Dcur " + tcur.SessionID + " (" + tcur.CursorID + ")"); + } + + public void addTuioBlob25D(TuioBlob25D tblb) + { + lock (blob25DList) + { + blob25DList.Add(tblb.SessionID, tblb); + } + if (verbose) + Console.WriteLine("add 25Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Angle + " " + tblb.Width + " " + tblb.Height + " " + tblb.Area); + } + + public void updateTuioBlob25D(TuioBlob25D tblb) + { + if (verbose) + Console.WriteLine("set 25Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Angle + " " + tblb.Width + " " + tblb.Height + " " + tblb.Area + " " + tblb.XSpeed + " " + tblb.YSpeed + " " + tblb.ZSpeed + " " + tblb.RotationSpeed + " " + tblb.MotionAccel + " " + tblb.RotationAccel); + } + + public void removeTuioBlob25D(TuioBlob25D tblb) + { + lock (blob25DList) + { + blob25DList.Remove(tblb.SessionID); + } + if (verbose) + Console.WriteLine("del 25Dblb " + tblb.SessionID + " (" + tblb.BlobID + ")"); + } + + + + + + + public void addTuioObject3D(TuioObject3D tobj) + { + lock (object3DList) + { + object3DList.Add(tobj.SessionID, tobj); + } + if (verbose) + Console.WriteLine("add 3Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Roll + " " + tobj.Pitch + " " + tobj.Yaw); + } + + public void updateTuioObject3D(TuioObject3D tobj) + { + if (verbose) + Console.WriteLine("set 3Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Roll + " " + tobj.Pitch + " " + tobj.Yaw + " " + tobj.XSpeed + " " + tobj.YSpeed + " " + tobj.ZSpeed + " " + tobj.RollSpeed + " " + tobj.PitchSpeed + " " + tobj.YawSpeed + " " + tobj.MotionAccel + " " + tobj.RotationAccel); + } + + public void removeTuioObject3D(TuioObject3D tobj) + { + lock (object3DList) + { + object3DList.Remove(tobj.SessionID); + } + if (verbose) + Console.WriteLine("del 3Dobj " + tobj.SessionID + " " + tobj.SymbolID); + } + + public void addTuioCursor3D(TuioCursor3D tcur) + { + lock (cursor3DList) + { + cursor3DList.Add(tcur.SessionID, tcur); + } + if (verbose) + Console.WriteLine("add 3Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z); + } + + public void updateTuioCursor3D(TuioCursor3D tcur) + { + if (verbose) + Console.WriteLine("set 3Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z + " " + tcur.XSpeed + " " + tcur.YSpeed + " " + tcur.ZSpeed + " " + tcur.MotionAccel); + } + + public void removeTuioCursor3D(TuioCursor3D tcur) + { + lock (cursor3DList) + { + cursor3DList.Remove(tcur.SessionID); + } + if (verbose) + Console.WriteLine("del 3Dcur " + tcur.SessionID + " (" + tcur.CursorID + ")"); + } + + public void addTuioBlob3D(TuioBlob3D tblb) + { + lock (blob3DList) + { + blob3DList.Add(tblb.SessionID, tblb); + } + if (verbose) + Console.WriteLine("add 3Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Roll + " " + tblb.Pitch + " " + tblb.Yaw + " " + tblb.Width + " " + tblb.Height + " " + tblb.Depth + " " + tblb.Volume); + } + + public void updateTuioBlob3D(TuioBlob3D tblb) + { + if (verbose) + Console.WriteLine("set 3Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Roll + " " + tblb.Pitch + " " + tblb.Yaw + " " + tblb.Width + " " + tblb.Height + " " + tblb.Depth + " " + tblb.Volume + " " + tblb.XSpeed + " " + tblb.YSpeed + " " + tblb.ZSpeed + " " + tblb.RollSpeed + " " + tblb.PitchSpeed + " " + tblb.YawSpeed + " " + tblb.MotionAccel + " " + tblb.RotationAccel); + } + + public void removeTuioBlob3D(TuioBlob3D tblb) + { + lock (blob3DList) + { + blob3DList.Remove(tblb.SessionID); + } + if (verbose) + Console.WriteLine("del 3Dblb " + tblb.SessionID + " (" + tblb.BlobID + ")"); + } + + + + + public void refresh(TuioTime frameTime) { Invalidate(); } @@ -206,7 +392,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) current_point = next_point; } g.FillEllipse(curBrush, current_point.getScreenX(width) - height / 100, current_point.getScreenY(height) - height / 100, height / 50, height / 50); - g.DrawString(tcur.CursorID + "", font, fntBrush, new PointF(tcur.getScreenX(width) - 10, tcur.getScreenY(height) - 10)); + g.DrawString("2Dcur "+tcur.CursorID + "", font, fntBrush, new PointF(tcur.getScreenX(width) - 10, tcur.getScreenY(height) - 10)); } } } @@ -229,7 +415,7 @@ protected override void OnPaintBackground(PaintEventArgs pevent) g.RotateTransform(-1 * (float)(tobj.Angle / Math.PI * 180.0f)); g.TranslateTransform(-ox, -oy); - g.DrawString(tobj.SymbolID + "", font, fntBrush, new PointF(ox - 10, oy - 10)); + g.DrawString("2Dobj " + tobj.SymbolID + "", font, fntBrush, new PointF(ox - 10, oy - 10)); } } } @@ -253,13 +439,170 @@ protected override void OnPaintBackground(PaintEventArgs pevent) g.RotateTransform(-1 * (float)(tblb.Angle / Math.PI * 180.0f)); g.TranslateTransform(-bx, -by); - g.DrawString(tblb.BlobID + "", font, fntBrush, new PointF(bx, by)); + g.DrawString("2Dblb " + + "" + tblb.BlobID + "", font, fntBrush, new PointF(bx, by)); } } } - } - public static void Main(String[] argv) { + // draw the 25Dcursor path + if (cursor25DList.Count > 0) + { + lock (cursor25DList) + { + foreach (TuioCursor25D tcur in cursor25DList.Values) + { + List path = tcur.Path; + TuioPoint current_point = path[0]; + + for (int i = 0; i < path.Count; i++) + { + TuioPoint next_point = path[i]; + g.DrawLine(curPen, current_point.getScreenX(width), current_point.getScreenY(height), next_point.getScreenX(width), next_point.getScreenY(height)); + current_point = next_point; + } + g.FillEllipse(curBrush, current_point.getScreenX(width) - height / 100, current_point.getScreenY(height) - height / 100, height / 50, height / 50); + g.DrawString("25Dcur " + tcur.CursorID + "", font, fntBrush, new PointF(tcur.getScreenX(width) - 10, tcur.getScreenY(height) - 10)); + } + } + } + + // draw the 25Dobjects + if (object25DList.Count > 0) + { + lock (object25DList) + { + foreach (TuioObject25D tobj in object25DList.Values) + { + int ox = tobj.getScreenX(width); + int oy = tobj.getScreenY(height); + int size = height / 10; + + g.TranslateTransform(ox, oy); + g.RotateTransform((float)(tobj.Angle / Math.PI * 180.0f)); + g.TranslateTransform(-ox, -oy); + + g.FillRectangle(objBrush, new Rectangle(ox - size / 2, oy - size / 2, size, size)); + + g.TranslateTransform(ox, oy); + g.RotateTransform(-1 * (float)(tobj.Angle / Math.PI * 180.0f)); + g.TranslateTransform(-ox, -oy); + + g.DrawString("25Dobj " + tobj.SymbolID + "", font, fntBrush, new PointF(ox - 10, oy - 10)); + } + } + } + + // draw the 25Dblobs + if (blob25DList.Count > 0) + { + lock (blob25DList) + { + foreach (TuioBlob25D tblb in blob25DList.Values) + { + int bx = tblb.getScreenX(width); + int by = tblb.getScreenY(height); + float bw = tblb.Width * width; + float bh = tblb.Height * height; + + g.TranslateTransform(bx, by); + g.RotateTransform((float)(tblb.Angle / Math.PI * 180.0f)); + g.TranslateTransform(-bx, -by); + + g.FillEllipse(blbBrush, bx - bw / 2, by - bh / 2, bw, bh); + + g.TranslateTransform(bx, by); + g.RotateTransform(-1 * (float)(tblb.Angle / Math.PI * 180.0f)); + g.TranslateTransform(-bx, -by); + + g.DrawString("25Dblb " + + "" + tblb.BlobID + "", font, fntBrush, new PointF(bx, by)); + } + } + } + + + // draw the 3Dcursor path + if (cursor3DList.Count > 0) + { + lock (cursor3DList) + { + foreach (TuioCursor3D tcur in cursor3DList.Values) + { + List path = tcur.Path; + TuioPoint current_point = path[0]; + + for (int i = 0; i < path.Count; i++) + { + TuioPoint next_point = path[i]; + g.DrawLine(curPen, current_point.getScreenX(width), current_point.getScreenY(height), next_point.getScreenX(width), next_point.getScreenY(height)); + current_point = next_point; + } + g.FillEllipse(curBrush, current_point.getScreenX(width) - height / 100, current_point.getScreenY(height) - height / 100, height / 50, height / 50); + g.DrawString("3Dcur " + tcur.CursorID + "", font, fntBrush, new PointF(tcur.getScreenX(width) - 10, tcur.getScreenY(height) - 10)); + } + } + } + + // draw the 3Dobjects + if (object3DList.Count > 0) + { + lock (object3DList) + { + foreach (TuioObject3D tobj in object3DList.Values) + { + int ox = tobj.getScreenX(width); + int oy = tobj.getScreenY(height); + int size = height / 10; + + g.TranslateTransform(ox, oy); + g.RotateTransform((float)(tobj.Roll / Math.PI * 180.0f)); + g.TranslateTransform(-ox, -oy); + + g.FillRectangle(objBrush, new Rectangle(ox - size / 2, oy - size / 2, size, size)); + + g.TranslateTransform(ox, oy); + g.RotateTransform(-1 * (float)(tobj.Roll / Math.PI * 180.0f)); + g.TranslateTransform(-ox, -oy); + + g.DrawString("3Dobj " + tobj.SymbolID + "", font, fntBrush, new PointF(ox - 10, oy - 10)); + } + } + } + + // draw the 3Dblobs + if (blob3DList.Count > 0) + { + lock (blob3DList) + { + foreach (TuioBlob3D tblb in blob3DList.Values) + { + int bx = tblb.getScreenX(width); + int by = tblb.getScreenY(height); + float bw = tblb.Width * width; + float bh = tblb.Height * height; + + g.TranslateTransform(bx, by); + g.RotateTransform((float)(tblb.Roll / Math.PI * 180.0f)); + g.TranslateTransform(-bx, -by); + + g.FillEllipse(blbBrush, bx - bw / 2, by - bh / 2, bw, bh); + + g.TranslateTransform(bx, by); + g.RotateTransform(-1 * (float)(tblb.Roll / Math.PI * 180.0f)); + g.TranslateTransform(-bx, -by); + + g.DrawString("3Dblb " + + "" + tblb.BlobID + "", font, fntBrush, new PointF(bx, by)); + } + } + } + + + + } + + public static void Main(String[] argv) { int port = 0; switch (argv.Length) { case 1: @@ -278,4 +621,6 @@ public static void Main(String[] argv) { TuioDemo app = new TuioDemo(port); Application.Run(app); } - } + + +} diff --git a/TuioDump.cs b/TuioDump.cs index d97dcc0..d7a3cd4 100644 --- a/TuioDump.cs +++ b/TuioDump.cs @@ -2,7 +2,7 @@ TUIO C# Example - part of the reacTIVision project http://reactivision.sourceforge.net/ - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,42 +26,152 @@ public class TuioDump : TuioListener { public void addTuioObject(TuioObject tobj) { - Console.WriteLine("add obj "+tobj.SymbolID+" "+tobj.SessionID+" "+tobj.X+" "+tobj.Y+" "+tobj.Angle); + Console.WriteLine("add obj "+tobj.SessionID+" " + tobj.SymbolID + " " + tobj.X+" "+tobj.Y+" "+tobj.Angle); } public void updateTuioObject(TuioObject tobj) { - Console.WriteLine("set obj "+tobj.SymbolID+" "+tobj.SessionID+" "+tobj.X+" "+tobj.Y+" "+tobj.Angle+" "+tobj.MotionSpeed+" "+tobj.RotationSpeed+" "+tobj.MotionAccel+" "+tobj.RotationAccel); + Console.WriteLine("set obj "+tobj.SessionID + " "+tobj.SymbolID + " "+tobj.X+" "+tobj.Y+" "+tobj.Angle + " " + tobj.XSpeed + " " + tobj.YSpeed + " "+tobj.RotationSpeed+" "+tobj.MotionAccel+" "+tobj.RotationAccel); } public void removeTuioObject(TuioObject tobj) { - Console.WriteLine("del obj "+tobj.SymbolID+" "+tobj.SessionID); + Console.WriteLine("del obj "+tobj.SessionID + " "+tobj.SymbolID); } public void addTuioCursor(TuioCursor tcur) { - Console.WriteLine("add cur "+tcur.CursorID + " ("+tcur.SessionID+") "+tcur.X+" "+tcur.Y); + Console.WriteLine("add cur "+tcur.SessionID + " ("+tcur.CursorID + ") "+tcur.X+" "+tcur.Y); } public void updateTuioCursor(TuioCursor tcur) { - Console.WriteLine("set cur "+tcur.CursorID + " ("+tcur.SessionID+") "+tcur.X+" "+tcur.Y+" "+tcur.MotionSpeed+" "+tcur.MotionAccel); + Console.WriteLine("set cur "+tcur.SessionID + " ("+tcur.CursorID + ") "+tcur.X+" "+tcur.Y+" "+ tcur.XSpeed + " " + tcur.YSpeed + " "+tcur.MotionAccel); } public void removeTuioCursor(TuioCursor tcur) { - Console.WriteLine("del cur "+tcur.CursorID + " ("+tcur.SessionID+")"); + Console.WriteLine("del cur "+tcur.SessionID + " ("+tcur.CursorID + ")"); } public void addTuioBlob(TuioBlob tblb) { - Console.WriteLine("add blb "+tblb.BlobID + " ("+tblb.SessionID+") "+tblb.X+" "+tblb.Y+" "+tblb.Angle+" "+tblb.Width+" "+tblb.Height+" "+tblb.Area); + Console.WriteLine("add blb "+tblb.SessionID + " ("+tblb.BlobID + ") "+tblb.X+" "+tblb.Y+" "+tblb.Angle+" "+tblb.Width+" "+tblb.Height+" "+tblb.Area); } public void updateTuioBlob(TuioBlob tblb) { - Console.WriteLine("set blb "+tblb.BlobID + " ("+tblb.SessionID+") "+tblb.X+" "+tblb.Y+" "+tblb.Angle+" "+tblb.Width+" "+tblb.Height+" "+tblb.Area+" "+tblb.MotionSpeed+" "+tblb.RotationSpeed+" "+tblb.MotionAccel+" "+tblb.RotationAccel); + Console.WriteLine("set blb "+tblb.SessionID + " ("+tblb.BlobID + ") "+tblb.X+" "+tblb.Y+" "+tblb.Angle+" "+tblb.Width+" "+tblb.Height+" "+tblb.Area+" "+ tblb.XSpeed + " " + tblb.YSpeed + " "+tblb.RotationSpeed+" "+tblb.MotionAccel+" "+tblb.RotationAccel); } public void removeTuioBlob(TuioBlob tblb) { - Console.WriteLine("del blb "+tblb.BlobID + " ("+tblb.SessionID+")"); + Console.WriteLine("del blb "+tblb.SessionID + " ("+tblb.BlobID + ")"); } - public void refresh(TuioTime frameTime) { + + + + + + + + public void addTuioObject25D(TuioObject25D tobj) + { + Console.WriteLine("add 25Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Angle); + } + + public void updateTuioObject25D(TuioObject25D tobj) + { + Console.WriteLine("set 25Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Angle + " " + tobj.XSpeed + " " + tobj.YSpeed + " " + tobj.ZSpeed + " " + tobj.RotationSpeed + " " + tobj.MotionAccel + " " + tobj.RotationAccel); + } + + public void removeTuioObject25D(TuioObject25D tobj) + { + Console.WriteLine("del 25Dobj " + tobj.SessionID + " " + tobj.SymbolID); + } + + public void addTuioCursor25D(TuioCursor25D tcur) + { + Console.WriteLine("add 25Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z); + } + + public void updateTuioCursor25D(TuioCursor25D tcur) + { + Console.WriteLine("set 25Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z + " " + tcur.XSpeed + " " + tcur.YSpeed + " " + tcur.ZSpeed + " " + tcur.MotionAccel); + } + + public void removeTuioCursor25D(TuioCursor25D tcur) + { + Console.WriteLine("del 25Dcur " + tcur.SessionID + " (" + tcur.CursorID + ")"); + } + + public void addTuioBlob25D(TuioBlob25D tblb) + { + Console.WriteLine("add 25Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Angle + " " + tblb.Width + " " + tblb.Height + " " + tblb.Area); + } + + public void updateTuioBlob25D(TuioBlob25D tblb) + { + Console.WriteLine("set 25Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Angle + " " + tblb.Width + " " + tblb.Height + " " + tblb.Area + " " + tblb.XSpeed + " " + tblb.YSpeed + " " + tblb.ZSpeed + " " + tblb.RotationSpeed + " " + tblb.MotionAccel + " " + tblb.RotationAccel); + } + + public void removeTuioBlob25D(TuioBlob25D tblb) + { + Console.WriteLine("del 25Dblb " + tblb.SessionID + " (" + tblb.BlobID + ")"); + } + + + + + + + public void addTuioObject3D(TuioObject3D tobj) + { + Console.WriteLine("add 3Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Roll + " " + tobj.Pitch + " " + tobj.Yaw); + } + + public void updateTuioObject3D(TuioObject3D tobj) + { + Console.WriteLine("set 3Dobj " + tobj.SessionID + " " + tobj.SymbolID + " " + tobj.X + " " + tobj.Y + " " + tobj.Z + " " + tobj.Roll + " " + tobj.Pitch + " " + tobj.Yaw + " " + tobj.XSpeed + " " + tobj.YSpeed + " " + tobj.ZSpeed + " " + tobj.RollSpeed + " " + tobj.PitchSpeed + " " + tobj.YawSpeed + " " + tobj.MotionAccel + " " + tobj.RotationAccel); + } + + public void removeTuioObject3D(TuioObject3D tobj) + { + Console.WriteLine("del 3Dobj " + tobj.SessionID + " " + tobj.SymbolID); + } + + public void addTuioCursor3D(TuioCursor3D tcur) + { + Console.WriteLine("add 3Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z); + } + + public void updateTuioCursor3D(TuioCursor3D tcur) + { + Console.WriteLine("set 3Dcur " + tcur.SessionID + " (" + tcur.CursorID + ") " + tcur.X + " " + tcur.Y + " " + tcur.Z + " " + tcur.XSpeed + " " + tcur.YSpeed + " " + tcur.ZSpeed + " " + tcur.MotionAccel); + } + + public void removeTuioCursor3D(TuioCursor3D tcur) + { + Console.WriteLine("del 3Dcur " + tcur.SessionID + " (" + tcur.CursorID + ")"); + } + + public void addTuioBlob3D(TuioBlob3D tblb) + { + Console.WriteLine("add 3Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Roll + " " + tblb.Pitch + " " + tblb.Yaw + " " + tblb.Width + " " + tblb.Height + " " + tblb.Depth + " " + tblb.Volume); + } + + public void updateTuioBlob3D(TuioBlob3D tblb) + { + Console.WriteLine("set 3Dblb " + tblb.SessionID + " (" + tblb.BlobID + ") " + tblb.X + " " + tblb.Y + " " + tblb.Z + " " + tblb.Roll + " " + tblb.Pitch + " " + tblb.Yaw + " " + tblb.Width + " " + tblb.Height + " " + tblb.Depth + " " + tblb.Volume + " " + tblb.XSpeed + " " + tblb.YSpeed + " " + tblb.ZSpeed + " " + tblb.RollSpeed + " " + tblb.PitchSpeed + " " + tblb.YawSpeed + " " + tblb.MotionAccel + " " + tblb.RotationAccel); + } + + public void removeTuioBlob3D(TuioBlob3D tblb) + { + Console.WriteLine("del 3Dblb " + tblb.SessionID + " (" + tblb.BlobID + ")"); + } + + + + + + + + + + public void refresh(TuioTime frameTime) { //Console.WriteLine("refresh "+frameTime.getTotalMilliseconds()); } diff --git a/doc/TUIO_CSHARP.xml b/doc/TUIO_CSHARP.xml index 6c55e9d..0dbe0e7 100644 --- a/doc/TUIO_CSHARP.xml +++ b/doc/TUIO_CSHARP.xml @@ -176,487 +176,1600 @@ A string representation of the value of the current object. - - * - * The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the {@link TuioListener} interface. - * In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events - * which are broadcasted to all registered classes that implement the {@link TuioListener} interface. - * - * - * - * TuioClient client = new TuioClient(); - * client.addTuioListener(myTuioListener); - * client.start(); - * - * - * - * @author Martin Kaltenbrunner - * @version 1.1.6 - - - * - * The default constructor creates a client that listens to the default TUIO port 3333 + + + The TuioBlob25D class encapsulates /tuio/25Dblb TUIO objects. + + + @author Nicolas Bremard + @version 1.1.7 - + - This constructor creates a client that listens to the provided port - the listening port number + The individual symbol ID number that is assigned to each TuioBlob25D. - - * - * Returns the port number listening to. - * the listening port number + + + The rotation angle value. - + - The TuioClient starts listening to TUIO messages on the configured UDP port - All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners + The blob width value. - + - The TuioClient stops listening to TUIO messages on the configured UDP port + The blob height value. - + - Returns true if this TuioClient is currently connected. - true if this TuioClient is currently connected + The blob area value. - - * - * The OSC callback method where all TUIO messages are received and decoded - * and where the TUIO event callbacks are dispatched - * the received OSC message + + + The rotation speed value. - - * - * Adds the provided TuioListener to the list of registered TUIO event listeners - * the TuioListener to add + + + The rotation acceleration value. - + - Removes the provided TuioListener from the list of registered TUIO event listeners - the TuioListener to remove + Defines the ROTATING state. - + - Removes all TuioListener from the list of registered TUIO event listeners + Defines the RESIZED state. - - * - * Returns a List of all currently active TuioObjects - * a List of all currently active TuioObjects + + + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioBlob25D. + + the TuioTime to assign + the Session ID to assign + the Blob ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle to assign + the width to assign + the height to assign + the area to assign - - - Returns a List of all currently active TuioCursors - a List of all currently active TuioCursors + + + This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioBlob25D. + + the Session ID to assign + the Blob ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle to assign + the width to assign + the height to assign + the area to assign - - - Returns a List of all currently active TuioBlobs - a List of all currently active TuioBlobs + + + This constructor takes the atttibutes of the provided TuioBlob25D + and assigs these values to the newly created TuioBlob25D. + + the TuioBlob25D to assign - - - Returns the TuioObject corresponding to the provided Session ID - or NULL if the Session ID does not refer to an active TuioObject - an active TuioObject corresponding to the provided Session ID or NULL + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioBlob25D attributes. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle coordinate to assign + the width to assign + the height to assign + the area to assign + the X velocity to assign + the Y velocity to assign + the rotation velocity to assign + the motion acceleration to assign + the rotation acceleration to assign - - - Returns the TuioCursor corresponding to the provided Session ID - or NULL if the Session ID does not refer to an active TuioCursor - an active TuioCursor corresponding to the provided Session ID or NULL + + + Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. + The TuioTime time stamp remains unchanged. + + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle coordinate to assign + the width to assign + the height to assign + the area to assign + the X velocity to assign + the Y velocity to assign + the rotation velocity to assign + the motion acceleration to assign + the rotation acceleration to assign - - - Returns the TuioBlob corresponding to the provided Session ID - or NULL if the Session ID does not refer to an active TuioBlob - an active TuioBlob corresponding to the provided Session ID or NULL + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioBlob25D attributes. + The speed and accleration values are calculated accordingly. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle coordinate to assign + the width to assign + the height to assign + the area to assign - - The abstract TuioContainer class defines common attributes that apply - to both subclasses (TuioObject and TuioCursor). - - + + + Takes the atttibutes of the provided TuioBlob25D + and assigs these values to this TuioBlob25D. + The TuioTime time stamp of this TuioContainer remains unchanged. - @author Martin Kaltenbrunner - @version 1.1.6 + the TuioContainer to assign - + - The unique session ID number that is assigned to each TUIO object or cursor. + This method is used to calculate the speed and acceleration values of a + TuioBlob25D with unchanged position and angle. - + - The X-axis velocity value. + Returns the symbol ID of this TuioBlob25D. + the symbol ID of this TuioBlob25D - + - The Y-axis velocity value. + Returns the width of this TuioBlob25D. + the width of this TuioBlob25D - + - The motion speed value. + Returns the height of this TuioBlob25D. + the heigth of this TuioBlob25D - + - The motion acceleration value. + Returns the area of this TuioBlob25D. + the area of this TuioBlob25D - + - A LinkedList of TuioPoints containing all the previous positions of the TUIO component. + Returns the rotation angle of this TuioBlob25D. + the rotation angle of this TuioBlob25D - + - Defines the ADDED state. + Returns the rotation angle in degrees of this TuioBlob25D. + the rotation angle in degrees of this TuioBlob25D - + - Defines the ACCELERATING state. + Returns the rotation speed of this TuioBlob25D. + the rotation speed of this TuioBlob25D - + - Defines the DECELERATING state. + Returns the rotation acceleration of this TuioBlob25D. + the rotation acceleration of this TuioBlob25D - + - Defines the STOPPED state. + Returns true of this TuioBlob25D is moving. + true of this TuioBlob25D is moving - + + + The TuioBlob3D class encapsulates /tuio/3Dblb TUIO objects. + + + @author Nicolas Bremard + @version 1.1.7 + + - Defines the REMOVED state. + The individual symbol ID number that is assigned to each TuioBlob3D. - + + The roll angle value. + + + The roll speed value. + + + The pitch angle value. + + + The pitch speed value. + + + The yaw angle value. + + + The yaw speed value. + + - Reflects the current state of the TuioComponent + The blob width value. - + - This constructor takes a TuioTime argument and assigns it along with the provided - Session ID, X and Y coordinate to the newly created TuioContainer. - - the TuioTime to assign - the Session ID to assign - the X coordinate to assign - the Y coordinate to assign + The blob height value. - + - This constructor takes the provided Session ID, X and Y coordinate - and assigs these values to the newly created TuioContainer. - - the Session ID to assign - the X coordinate to assign - the Y coordinate to assign + The blob height value. - + - This constructor takes the atttibutes of the provided TuioContainer - and assigs these values to the newly created TuioContainer. - - the TuioContainer to assign + The blob volume value. - - * - * Takes a TuioTime argument and assigns it along with the provided - * X and Y coordinate to the private TuioContainer attributes. - * The speed and accleration values are calculated accordingly. - * the TuioTime to assign - * the X coordinate to assign - * the Y coordinate to assign + + + The rotation acceleration value. - + - This method is used to calculate the speed and acceleration values of - TuioContainers with unchanged positions. + Defines the ROTATING state. - + + + Defines the RESIZED state. + + - Takes a TuioTime argument and assigns it along with the provided - X and Y coordinate, X and Y velocity and acceleration - to the private TuioContainer attributes. + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioBlob3D. the TuioTime to assign + the Session ID to assign + the Blob ID to assign the X coordinate to assign the Y coordinate to assign - the X velocity to assign - the Y velocity to assign - the acceleration to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign + the width to assign + the height to assign + the depth to assign + the volume to assign - + - Assigns the provided X and Y coordinate, X and Y velocity and acceleration - to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. + This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioBlob3D. + the Session ID to assign + the Blob ID to assign the X coordinate to assign the Y coordinate to assign - the X velocity to assign - the Y velocity to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign + the width to assign + the height to assign + the depth to assign + the volume to assign + + + + This constructor takes the atttibutes of the provided TuioBlob3D + and assigs these values to the newly created TuioBlob3D. + + the TuioBlob3D to assign + + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioBlob3D attributes. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign + the width to assign + the height to assign + the depth to assign + the volume to assign + the X velocity to assign + the Y velocity to assign + the Y velocity to assign + the roll speed to assign + the pitch speed to assign + the yaw speed to assign + the motion acceleration to assign + the rotation acceleration to assign + + + + Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. + The TuioTime time stamp remains unchanged. + + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign + the width to assign + the height to assign + the depth to assign + the volume to assign + the X velocity to assign + the Y velocity to assign + the Y velocity to assign + the roll speed to assign + the pitch speed to assign + the yaw speed to assign + the motion acceleration to assign + the rotation acceleration to assign + + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioBlob3D attributes. + The speed and accleration values are calculated accordingly. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign + the width to assign + the height to assign + the depth to assign + the volume to assign + + + + Takes the atttibutes of the provided TuioBlob3D + and assigs these values to this TuioBlob3D. + The TuioTime time stamp of this TuioContainer remains unchanged. + + the TuioContainer to assign + + + + This method is used to calculate the speed and acceleration values of a + TuioBlob3D with unchanged position and angle. + + + + Returns the symbol ID of this TuioBlob3D. + the symbol ID of this TuioBlob3D + + + + Returns the width of this TuioBlob3D. + the width of this TuioBlob3D + + + + Returns the height of this TuioBlob3D. + the heigth of this TuioBlob3D + + + + Returns the depth of this TuioBlob3D. + the depth of this TuioBlob3D + + + + Returns the volume of this TuioBlob3D. + the volume of this TuioBlob3D + + + + Returns the rotation roll of this TuioBlob3D. + the rotation roll of this TuioBlob3D + + + + Returns the rotation roll in degrees of this TuioBlob3D. + the rotation roll in degrees of this TuioBlob3D + + + + Returns the rotation pitch of this TuioBlob3D. + the rotation pitch of this TuioBlob3D + + + + Returns the rotation pitch in degrees of this TuioBlob3D. + the rotation pitch in degrees of this TuioBlob3D + + + + Returns the rotation yaw of this TuioBlob3D. + the rotation yaw of this TuioBlob3D + + + + Returns the rotation yaw in degrees of this TuioBlob3D. + the rotation yaw in degrees of this TuioBlob3D + + + + Returns the roll speed of this TuioBlob3D. + the roll speed of this TuioBlob3D + + + + Returns the pitch speed of this TuioBlob3D. + the pitch speed of this TuioBlob3D + + + + Returns the yaw speed of this TuioBlob3D. + the yaw speed of this TuioBlob3D + + + + Returns the rotation acceleration of this TuioBlob3D. + the rotation acceleration of this TuioBlob3D + + + + Returns true of this TuioBlob3D is moving. + true of this TuioBlob3D is moving + + + * + * The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the {@link TuioListener} interface. + * In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events + * which are broadcasted to all registered classes that implement the {@link TuioListener} interface. + * + * + * + * TuioClient client = new TuioClient(); + * client.addTuioListener(myTuioListener); + * client.start(); + * + * + * + * @author Martin Kaltenbrunner + * @version 1.1.6 + + + * + * The default constructor creates a client that listens to the default TUIO port 3333 + + + + This constructor creates a client that listens to the provided port + the listening port number + + + * + * Returns the port number listening to. + * the listening port number + + + + The TuioClient starts listening to TUIO messages on the configured UDP port + All reveived TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners + + + + The TuioClient stops listening to TUIO messages on the configured UDP port + + + + Returns true if this TuioClient is currently connected. + true if this TuioClient is currently connected + + + * + * The OSC callback method where all TUIO messages are received and decoded + * and where the TUIO event callbacks are dispatched + * the received OSC message + + + * + * Adds the provided TuioListener to the list of registered TUIO event listeners + * the TuioListener to add + + + + Removes the provided TuioListener from the list of registered TUIO event listeners + the TuioListener to remove + + + + Removes all TuioListener from the list of registered TUIO event listeners + + + * + * Returns a List of all currently active TuioObjects + * a List of all currently active TuioObjects + + + + Returns a List of all currently active TuioCursors + a List of all currently active TuioCursors + + + + Returns a List of all currently active TuioBlobs + a List of all currently active TuioBlobs + + + + Returns the TuioObject corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioObject + an active TuioObject corresponding to the provided Session ID or NULL + + + + Returns the TuioCursor corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioCursor + an active TuioCursor corresponding to the provided Session ID or NULL + + + + Returns the TuioBlob corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioBlob + an active TuioBlob corresponding to the provided Session ID or NULL + + + + Returns a List of all currently active TuioObjects25D + a List of all currently active TuioObjects25D + + + + Returns a List of all currently active TuioCursors25D + a List of all currently active TuioCursors25D + + + + Returns a List of all currently active TuioBlobs25D + a List of all currently active TuioBlobs25D + + + + Returns the TuioObject25D corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioObject25D + an active TuioObject25D corresponding to the provided Session ID or NULL + + + + Returns the TuioCursor25D corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioCursor25D + an active TuioCursor25D corresponding to the provided Session ID or NULL + + + + Returns the TuioBlob25D corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioBlob25D + an active TuioBlob25D corresponding to the provided Session ID or NULL + + + + Returns a List of all currently active TuioObjects3D + a List of all currently active TuioObjects3D + + + + Returns a List of all currently active TuioCursors3D + a List of all currently active TuioCursors3D + + + + Returns a List of all currently active TuioBlobs3D + a List of all currently active TuioBlobs3D + + + + Returns the TuioObject3D corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioObject3D + an active TuioObject3D corresponding to the provided Session ID or NULL + + + + Returns the TuioCursor3D corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioCursor3D + an active TuioCursor3D corresponding to the provided Session ID or NULL + + + + Returns the TuioBlob3D corresponding to the provided Session ID + or NULL if the Session ID does not refer to an active TuioBlob3D + an active TuioBlob3D corresponding to the provided Session ID or NULL + + + The abstract TuioContainer class defines common attributes that apply + to both subclasses (TuioObject and TuioCursor). + + + + @author Martin Kaltenbrunner + @version 1.1.6 + + + + The unique session ID number that is assigned to each TUIO object or cursor. + + + + The X-axis velocity value. + + + + The Y-axis velocity value. + + + + The Z-axis velocity value. + + + + The motion speed value. + + + + The motion acceleration value. + + + + A LinkedList of TuioPoints containing all the previous positions of the TUIO component. + + + + Defines the REMOVED state. + + + + Defines the ADDED state. + + + + Defines the ACCELERATING state. + + + + Defines the DECELERATING state. + + + + Defines the STOPPED state. + + + + Defines the REMOVED state. + + + + Reflects the current state of the TuioComponent + + + + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, X and Y coordinate to the newly created TuioContainer. + + the TuioTime to assign + the Session ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + + + + This constructor takes the provided Session ID, X and Y coordinate + and assigs these values to the newly created TuioContainer. + + the Session ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + + + + This constructor takes the atttibutes of the provided TuioContainer + and assigs these values to the newly created TuioContainer. + + the TuioContainer to assign + + + * + * Takes a TuioTime argument and assigns it along with the provided + * X and Y coordinate to the private TuioContainer attributes. + * The speed and accleration values are calculated accordingly. + * the TuioTime to assign + * the X coordinate to assign + * the Y coordinate to assign + * the Z coordinate to assign + + + + This method is used to calculate the speed and acceleration values of + TuioContainers with unchanged positions. + + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Y coordinate to assign + the X velocity to assign + the Y velocity to assign + the Y velocity to assign + the acceleration to assign + + + + Assigns the provided X and Y coordinate, X and Y velocity and acceleration + to the private TuioContainer attributes. The TuioTime time stamp remains unchanged. + + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the X velocity to assign + the Y velocity to assign + the Z velocity to assign the acceleration to assign - + + + Takes the atttibutes of the provided TuioContainer + and assigs these values to this TuioContainer. + The TuioTime time stamp of this TuioContainer remains unchanged. + + the TuioContainer to assign + + + + Assigns the REMOVE state to this TuioContainer and sets + its TuioTime time stamp to the provided TuioTime argument. + + the TuioTime to assign + + + + Returns the Session ID of this TuioContainer. + the Session ID of this TuioContainer + + + + Returns the X velocity of this TuioContainer. + the X velocity of this TuioContainer + + + + Returns the Y velocity of this TuioContainer. + the Y velocity of this TuioContainer + + + + Returns the Z velocity of this TuioContainer. + the Z velocity of this TuioContainer + + + + Returns the position of this TuioContainer. + the position of this TuioContainer + + + + Returns the path of this TuioContainer. + the path of this TuioContainer + + + + Returns the motion speed of this TuioContainer. + the motion speed of this TuioContainer + + + + Returns the motion acceleration of this TuioContainer. + the motion acceleration of this TuioContainer + + + + Returns the TUIO state of this TuioContainer. + the TUIO state of this TuioContainer + + + + Returns true of this TuioContainer is moving. + true of this TuioContainer is moving + + + + The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. + + @author Martin Kaltenbrunner + @version 1.1.6 + + + + The individual cursor ID number that is assigned to each TuioCursor. + + + + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. + + the TuioTime to assign + the Session ID to assign + the Cursor ID to assign + the X coordinate to assign + the Y coordinate to assign + + + + This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + and assigs these values to the newly created TuioCursor. + + the Session ID to assign + the Cursor ID to assign + the X coordinate to assign + the Y coordinate to assign + + + + This constructor takes the atttibutes of the provided TuioCursor + and assigs these values to the newly created TuioCursor. + + the TuioCursor to assign + + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioObject attributes. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the X velocity to assign + the Y velocity to assign + the motion acceleration to assign + + + + Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. + The TuioTime time stamp remains unchanged. + + the X coordinate to assign + the Y coordinate to assign + the X velocity to assign + the Y velocity to assign + the motion acceleration to assign + + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioObject attributes. + The speed and accleration values are calculated accordingly. + + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + + + + Takes the atttibutes of the provided TuioCursor + and assigs these values to this TuioCursor. + The TuioTime time stamp of this TuioContainer remains unchanged. + + the TuioContainer to assign + + + + This method is used to calculate the speed and acceleration values of a + TuioCursor. + + + + Returns the Cursor ID of this TuioCursor. + the Cursor ID of this TuioCursor + + + + The TuioCursor25D class encapsulates /tuio/25Dcur TUIO cursors. + + @authorNicolas Bremard + @version 1.1.7 + + + + The individual cursor ID number that is assigned to each TuioCursor25D. + + + + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor25D. + + the TuioTime to assign + the Session ID to assign + the Cursor ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + + + + This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + and assigs these values to the newly created TuioCursor25D. + + the Session ID to assign + the Cursor ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + + + + This constructor takes the atttibutes of the provided TuioCursor25D + and assigs these values to the newly created TuioCursor25D. + + the TuioCursor25D to assign + + + + Returns the Cursor ID of this TuioCursor25D. + the Cursor ID of this TuioCursor25D + + + + The TuioCursor3D class encapsulates /tuio/3Dcur TUIO cursors. + + @authorNicolas Bremard + @version 1.1.7 + + + + The individual cursor ID number that is assigned to each TuioCursor3D. + + + + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor3D. + + the TuioTime to assign + the Session ID to assign + the Cursor ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + + + + This constructor takes the provided Session ID, Cursor ID, X and Y coordinate + and assigs these values to the newly created TuioCursor3D. + + the Session ID to assign + the Cursor ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + + + + This constructor takes the atttibutes of the provided TuioCursor3D + and assigs these values to the newly created TuioCursor3D. + + the TuioCursor3D to assign + + + + Returns the Cursor ID of this TuioCursor3D. + the Cursor ID of this TuioCursor3D + + + + The TuioListener interface provides a simple callback infrastructure which is used by the {@link TuioClient} class + to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here. + + + Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. + The {@link TuioClient} makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations. + + + + public class MyTuioListener implements TuioListener + ... + MyTuioListener listener = new MyTuioListener(); + TuioClient client = new TuioClient(); + client.addTuioListener(listener); + client.start(); + + + + @author Nicolas Bremard + @version 1.1.7 + + + + This callback method is invoked by the TuioClient when a new TuioObject is added to the session. + + the TuioObject reference associated to the addTuioObject event + + + + This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. + + the TuioObject reference associated to the updateTuioObject event + + + + This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. + + the TuioObject reference associated to the removeTuioObject event + + + + This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. + + the TuioCursor reference associated to the addTuioCursor event + + + + This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. + + the TuioCursor reference associated to the updateTuioCursor event + + + + This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. + + the TuioCursor reference associated to the removeTuioCursor event + + + + This callback method is invoked by the TuioClient when a new TuioBlob is added to the session. + + the TuioBlob reference associated to the addTuioBlob event + + + + This callback method is invoked by the TuioClient when an existing TuioBlob is updated during the session. + + the TuioBlob reference associated to the updateTuioBlob event + + + + This callback method is invoked by the TuioClient when an existing TuioBlob is removed from the session. + + the TuioBlob reference associated to the removeTuioBlob event + + + + This callback method is invoked by the TuioClient when a new TuioObject25D is added to the session. + + the TuioObject25D reference associated to the addTuioObject25D event + + + + This callback method is invoked by the TuioClient when an existing TuioObject25D is updated during the session. + + the TuioObject25D reference associated to the updateTuioObject25D event + + + + This callback method is invoked by the TuioClient when an existing TuioObject25D is removed from the session. + + the TuioObject25D reference associated to the removeTuioObject25D event + + + + This callback method is invoked by the TuioClient when a new TuioCursor25D is added to the session. + + the TuioCursor25D reference associated to the addTuioCursor25D event + + + + This callback method is invoked by the TuioClient when an existing TuioCursor25D is updated during the session. + + the TuioCursor25D reference associated to the updateTuioCursor25D event + + + + This callback method is invoked by the TuioClient when an existing TuioCursor25D is removed from the session. + + the TuioCursor25D reference associated to the removeTuioCursor25D event + + + + This callback method is invoked by the TuioClient when a new TuioBlob25D is added to the session. + + the TuioBlob25D reference associated to the addTuioBlob25D event + + + + This callback method is invoked by the TuioClient when an existing TuioBlob25D is updated during the session. + + the TuioBlob25D reference associated to the updateTuioBlob25D event + + + + This callback method is invoked by the TuioClient when an existing TuioBlob25D is removed from the session. + + the TuioBlob25D reference associated to the removeTuioBlob25D event + + - Takes the atttibutes of the provided TuioContainer - and assigs these values to this TuioContainer. - The TuioTime time stamp of this TuioContainer remains unchanged. + This callback method is invoked by the TuioClient when a new TuioObject3D is added to the session. - the TuioContainer to assign + the TuioObject3D reference associated to the addTuioObject3D event - + - Assigns the REMOVE state to this TuioContainer and sets - its TuioTime time stamp to the provided TuioTime argument. + This callback method is invoked by the TuioClient when an existing TuioObject3D is updated during the session. - the TuioTime to assign + the TuioObject3D reference associated to the updateTuioObject3D event - - - Returns the Session ID of this TuioContainer. - the Session ID of this TuioContainer + + + This callback method is invoked by the TuioClient when an existing TuioObject3D is removed from the session. + + the TuioObject3D reference associated to the removeTuioObject3D event - - - Returns the X velocity of this TuioContainer. - the X velocity of this TuioContainer + + + This callback method is invoked by the TuioClient when a new TuioCursor3D is added to the session. + + the TuioCursor3D reference associated to the addTuioCursor3D event - - - Returns the Y velocity of this TuioContainer. - the Y velocity of this TuioContainer + + + This callback method is invoked by the TuioClient when an existing TuioCursor3D is updated during the session. + + the TuioCursor3D reference associated to the updateTuioCursor3D event - - - Returns the position of this TuioContainer. - the position of this TuioContainer + + + This callback method is invoked by the TuioClient when an existing TuioCursor3D is removed from the session. + + the TuioCursor3D reference associated to the removeTuioCursor3D event - - - Returns the path of this TuioContainer. - the path of this TuioContainer + + + This callback method is invoked by the TuioClient when a new TuioBlob3D is added to the session. + + the TuioBlob3D reference associated to the addTuioBlob3D event - - - Returns the motion speed of this TuioContainer. - the motion speed of this TuioContainer + + + This callback method is invoked by the TuioClient when an existing TuioBlob3D is updated during the session. + + the TuioBlob3D reference associated to the updateTuioBlob3D event - + + + This callback method is invoked by the TuioClient when an existing TuioBlob3D is removed from the session. + + the TuioBlob3D reference associated to the removeTuioBlob3D event + + + + This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. + + the TuioTime associated to the current TUIO message bundle + + + + The TuioObject class encapsulates /tuio/2Dobj TUIO objects. + + + @author Martin Kaltenbrunner + @version 1.1.6 + + - Returns the motion acceleration of this TuioContainer. - the motion acceleration of this TuioContainer + The individual symbol ID number that is assigned to each TuioObject. - + - Returns the TUIO state of this TuioContainer. - the TUIO state of this TuioContainer + The rotation angle value. - + - Returns true of this TuioContainer is moving. - true of this TuioContainer is moving + The rotation speed value. - - - The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. - - @author Martin Kaltenbrunner - @version 1.1.6 + + + The rotation acceleration value. - + - The individual cursor ID number that is assigned to each TuioCursor. + Defines the ROTATING state. - + This constructor takes a TuioTime argument and assigns it along with the provided - Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. the TuioTime to assign the Session ID to assign - the Cursor ID to assign + the Symbol ID to assign the X coordinate to assign the Y coordinate to assign + the angle to assign - + - This constructor takes the provided Session ID, Cursor ID, X and Y coordinate - and assigs these values to the newly created TuioCursor. + This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioObject. the Session ID to assign - the Cursor ID to assign + the Symbol ID to assign the X coordinate to assign the Y coordinate to assign + the angle to assign - + - This constructor takes the atttibutes of the provided TuioCursor - and assigs these values to the newly created TuioCursor. + This constructor takes the atttibutes of the provided TuioObject + and assigs these values to the newly created TuioObject. - the TuioCursor to assign - - - - Returns the Cursor ID of this TuioCursor. - the Cursor ID of this TuioCursor + the TuioObject to assign - - - The TuioListener interface provides a simple callback infrastructure which is used by the {@link TuioClient} class - to dispatch TUIO events to all registered instances of classes that implement the TuioListener interface defined here. - - - Any class that implements the TuioListener interface is required to implement all of the callback methods defined here. - The {@link TuioClient} makes use of these interface methods in order to dispatch TUIO events to all registered TuioListener implementations. - - - - public class MyTuioListener implements TuioListener - ... - MyTuioListener listener = new MyTuioListener(); - TuioClient client = new TuioClient(); - client.addTuioListener(listener); - client.start(); - - + + + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioObject attributes. - @author Martin Kaltenbrunner - @version 1.1.6 + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the angle coordinate to assign + the X velocity to assign + the Y velocity to assign + the rotation velocity to assign + the motion acceleration to assign + the rotation acceleration to assign - + - This callback method is invoked by the TuioClient when a new TuioObject is added to the session. + Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. + The TuioTime time stamp remains unchanged. - the TuioObject reference associated to the addTuioObject event + the X coordinate to assign + the Y coordinate to assign + the angle coordinate to assign + the X velocity to assign + the Y velocity to assign + the rotation velocity to assign + the motion acceleration to assign + the rotation acceleration to assign - + - This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session. + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioObject attributes. + The speed and accleration values are calculated accordingly. - the TuioObject reference associated to the updateTuioObject event + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the angle coordinate to assign - + - This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session. + Takes the atttibutes of the provided TuioObject + and assigs these values to this TuioObject. + The TuioTime time stamp of this TuioContainer remains unchanged. - the TuioObject reference associated to the removeTuioObject event + the TuioContainer to assign - + + + This method is used to calculate the speed and acceleration values of a + TuioObject with unchanged position and angle. + + + + Returns the symbol ID of this TuioObject. + the symbol ID of this TuioObject + + + + Returns the rotation angle of this TuioObject. + the rotation angle of this TuioObject + + + + Returns the rotation angle in degrees of this TuioObject. + the rotation angle in degrees of this TuioObject + + + + Returns the rotation speed of this TuioObject. + the rotation speed of this TuioObject + + + + Returns the rotation acceleration of this TuioObject. + the rotation acceleration of this TuioObject + + + + Returns true of this TuioObject is moving. + true of this TuioObject is moving + + + + The TuioObject class encapsulates /tuio/25Dobj TUIO objects. + + + @author Nicolas Bremard + @version 1.1.7 + + + + The individual symbol ID number that is assigned to each TuioObject. + + + + The rotation angle value. + + + + The rotation speed value. + + + + The rotation acceleration value. + + + + Defines the ROTATING state. + + - This callback method is invoked by the TuioClient when a new TuioCursor is added to the session. + This constructor takes a TuioTime argument and assigns it along with the provided + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject25D. - the TuioCursor reference associated to the addTuioCursor event + the TuioTime to assign + the Session ID to assign + the Symbol ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle to assign - + - This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session. + This constructor takes the provided Session ID, Symbol ID, X and Y coordinate + and angle, and assigs these values to the newly created TuioObject25D. - the TuioCursor reference associated to the updateTuioCursor event + the Session ID to assign + the Symbol ID to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle to assign - + - This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session. + This constructor takes the atttibutes of the provided TuioObject25D + and assigs these values to the newly created TuioObject25D. - the TuioCursor reference associated to the removeTuioCursor event + the TuioObject25D to assign - + - This callback method is invoked by the TuioClient when a new TuioBlob is added to the session. + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate, angle, X and Y velocity, motion acceleration, + rotation speed and rotation acceleration to the private TuioObject25D attributes. - the TuioBlob reference associated to the addTuioBlob event + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle coordinate to assign + the X velocity to assign + the Y velocity to assign + the Z velocity to assign + the rotation velocity to assign + the motion acceleration to assign + the rotation acceleration to assign - + - This callback method is invoked by the TuioClient when an existing TuioBlob is updated during the session. + Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration + rotation velocity and rotation acceleration to the private TuioContainer attributes. + The TuioTime time stamp remains unchanged. - the TuioBlob reference associated to the updateTuioBlob event + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle coordinate to assign + the X velocity to assign + the Y velocity to assign + the Z velocity to assign + the rotation velocity to assign + the motion acceleration to assign + the rotation acceleration to assign - + - This callback method is invoked by the TuioClient when an existing TuioBlob is removed from the session. + Takes a TuioTime argument and assigns it along with the provided + X and Y coordinate and angle to the private TuioObject25D attributes. + The speed and accleration values are calculated accordingly. - the TuioBlob reference associated to the removeTuioBlob event + the TuioTime to assign + the X coordinate to assign + the Y coordinate to assign + the Z coordinate to assign + the angle coordinate to assign - + - This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle. + Takes the atttibutes of the provided TuioObject25D + and assigs these values to this TuioObject25D. + The TuioTime time stamp of this TuioContainer remains unchanged. - the TuioTime associated to the current TUIO message bundle + the TuioContainer to assign - + + + This method is used to calculate the speed and acceleration values of a + TuioObject25D with unchanged position and angle. + + + + Returns the symbol ID of this TuioObject25D. + the symbol ID of this TuioObject25D + + + + Returns the rotation angle of this TuioObject25D. + the rotation angle of this TuioObject25D + + + + Returns the rotation angle in degrees of this TuioObject25D. + the rotation angle in degrees of this TuioObject25D + + + + Returns the rotation speed of this TuioObject25D. + the rotation speed of this TuioObject25D + + + + Returns the rotation acceleration of this TuioObject25D. + the rotation acceleration of this TuioObject25D + + + + Returns true of this TuioObject25D is moving. + true of this TuioObject25D is moving + + - The TuioObject class encapsulates /tuio/2Dobj TUIO objects. + The TuioObject class encapsulates /tuio/3Dobj TUIO objects. - @author Martin Kaltenbrunner - @version 1.1.6 + @author Nicolas Bremard + @version 1.1.7 - + The individual symbol ID number that is assigned to each TuioObject. - + - The rotation angle value. + The roll angle value. - + - The rotation speed value. + The roll speed value. - + + + The pitch angle value. + + + + The pitch speed value. + + + + The yaw angle value. + + + + The yaw speed value. + + The rotation acceleration value. - + Defines the ROTATING state. - + This constructor takes a TuioTime argument and assigns it along with the provided - Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject. + Session ID, Symbol ID, X and Y coordinate and angle to the newly created TuioObject3D. the TuioTime to assign the Session ID to assign the Symbol ID to assign the X coordinate to assign the Y coordinate to assign - the angle to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign - + This constructor takes the provided Session ID, Symbol ID, X and Y coordinate - and angle, and assigs these values to the newly created TuioObject. + and angle, and assigs these values to the newly created TuioObject3D. the Session ID to assign the Symbol ID to assign the X coordinate to assign the Y coordinate to assign - the angle to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign - + - This constructor takes the atttibutes of the provided TuioObject - and assigs these values to the newly created TuioObject. + This constructor takes the atttibutes of the provided TuioObject3D + and assigs these values to the newly created TuioObject3D. - the TuioObject to assign + the TuioObject3D to assign - + Takes a TuioTime argument and assigns it along with the provided X and Y coordinate, angle, X and Y velocity, motion acceleration, - rotation speed and rotation acceleration to the private TuioObject attributes. + rotation speed and rotation acceleration to the private TuioObject3D attributes. the TuioTime to assign the X coordinate to assign the Y coordinate to assign - the angle coordinate to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign the X velocity to assign the Y velocity to assign - the rotation velocity to assign + the Z velocity to assign + the roll speed to assign + the pitch speed to assign + the yaw speed to assign the motion acceleration to assign the rotation acceleration to assign - + Assigns the provided X and Y coordinate, angle, X and Y velocity, motion acceleration rotation velocity and rotation acceleration to the private TuioContainer attributes. @@ -664,66 +1777,103 @@ the X coordinate to assign the Y coordinate to assign - the angle coordinate to assign + the Z coordinate to assign + the roll to assign + the pitch to assign + the yaw to assign the X velocity to assign the Y velocity to assign - the rotation velocity to assign + the Z velocity to assign + the roll speed to assign + the pitch speed to assign + the yaw speed to assign the motion acceleration to assign the rotation acceleration to assign - + Takes a TuioTime argument and assigns it along with the provided - X and Y coordinate and angle to the private TuioObject attributes. + X and Y coordinate and angle to the private TuioObject3D attributes. The speed and accleration values are calculated accordingly. the TuioTime to assign the X coordinate to assign the Y coordinate to assign + the Z coordinate to assign the angle coordinate to assign - + - Takes the atttibutes of the provided TuioObject - and assigs these values to this TuioObject. + Takes the atttibutes of the provided TuioObject3D + and assigs these values to this TuioObject3D. The TuioTime time stamp of this TuioContainer remains unchanged. the TuioContainer to assign - + This method is used to calculate the speed and acceleration values of a - TuioObject with unchanged position and angle. + TuioObject3D with unchanged position and angle. - + - Returns the symbol ID of this TuioObject. - the symbol ID of this TuioObject + Returns the symbol ID of this TuioObject3D. + the symbol ID of this TuioObject3D - + - Returns the rotation angle of this TuioObject. - the rotation angle of this TuioObject + Returns the rotation roll of this TuioObject3D. + the rotation roll of this TuioObject3D - + - Returns the rotation angle in degrees of this TuioObject. - the rotation angle in degrees of this TuioObject + Returns the rotation roll in degrees of this TuioObject3D. + the rotation roll in degrees of this TuioObject3D - + - Returns the rotation speed of this TuioObject. - the rotation speed of this TuioObject + Returns the rotation pitch of this TuioObject3D. + the rotation pitch of this TuioObject3D - + - Returns the rotation acceleration of this TuioObject. - the rotation acceleration of this TuioObject + Returns the rotation pitch in degrees of this TuioObject3D. + the rotation pitch in degrees of this TuioObject3D - + - Returns true of this TuioObject is moving. - true of this TuioObject is moving + Returns the rotation yaw of this TuioObject3D. + the rotation yaw of this TuioObject3D + + + + Returns the rotation yaw in degrees of this TuioObject3D. + the rotation yaw in degrees of this TuioObject3D + + + + Returns the roll speed of this TuioObject3D. + the roll speed of this TuioObject3D + + + + Returns the pitch speed of this TuioObject3D. + the pitch speed of this TuioObject3D + + + + Returns the yaw speed of this TuioObject3D. + the yaw speed of this TuioObject3D + + + + Returns the rotation acceleration of this TuioObject3D. + the rotation acceleration of this TuioObject3D + + + + Returns true of this TuioObject3D is moving. + true of this TuioObject3D is moving The TuioPoint class on the one hand is a simple container and utility class to handle TUIO positions in general, @@ -740,6 +1890,10 @@ Y coordinate, representated as a floating point value in a range of 0..1 + + + Z coordinate, representated as a floating point value in a range of 0..1 + The time stamp of the last update represented as TuioTime (time since session start) @@ -753,13 +1907,14 @@ The default constructor takes no arguments and sets its coordinate attributes to zero and its time stamp to the current session time. - + This constructor takes two floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the current session time. the X coordinate to assign the Y coordinate to assign + the Z coordinate to assign @@ -768,7 +1923,7 @@ the TuioPoint to assign - + This constructor takes a TuioTime object and two floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the provided TUIO time object. @@ -776,6 +1931,7 @@ the TuioTime to assign the X coordinate to assign the Y coordinate to assign + the Z coordinate to assign @@ -784,15 +1940,16 @@ the TuioPoint to assign - + Takes two floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint and leaves its time stamp unchanged. the X coordinate to assign the Y coordinate to assign + the Z coordinate to assign - + Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint and its time stamp to the provided TUIO time object. @@ -800,6 +1957,7 @@ the TuioTime to assign the X coordinate to assign the Y coordinate to assign + the Z coordinate to assign @@ -811,6 +1969,11 @@ Returns the Y coordinate of this TuioPoint. the Y coordinate of this TuioPoint + + + Returns the Z coordinate of this TuioPoint. + the Z coordinate of this TuioPoint + Returns the distance to the provided coordinates @@ -819,6 +1982,15 @@ the Y coordinate of the distant point the distance to the provided coordinates + + + Returns the distance to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the Z coordinate of the distant point + the distance to the provided coordinates + Returns the distance to the provided TuioPoint @@ -826,6 +1998,15 @@ the distant TuioPoint the distance to the provided TuioPoint + + + Returns the distance to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the Z coordinate of the distant point + the distance to the provided coordinates + Returns the angle to the provided coordinates @@ -856,6 +2037,96 @@ the distant TuioPoint the angle in degrees to the provided TuioPoint + + + Returns the angle to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the angle to the provided coordinates + + + + Returns the angle to the provided TuioPoint + + the distant TuioPoint + the angle to the provided TuioPoint + + + + Returns the angle in degrees to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the angle in degrees to the provided TuioPoint + + + + Returns the angle in degrees to the provided TuioPoint + + the distant TuioPoint + the angle in degrees to the provided TuioPoint + + + + Returns the angle to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the angle to the provided coordinates + + + + Returns the angle to the provided TuioPoint + + the distant TuioPoint + the angle to the provided TuioPoint + + + + Returns the angle in degrees to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the angle in degrees to the provided TuioPoint + + + + Returns the angle in degrees to the provided TuioPoint + + the distant TuioPoint + the angle in degrees to the provided TuioPoint + + + + Returns the angle to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the angle to the provided coordinates + + + + Returns the angle to the provided TuioPoint + + the distant TuioPoint + the angle to the provided TuioPoint + + + + Returns the angle in degrees to the provided coordinates + + the X coordinate of the distant point + the Y coordinate of the distant point + the angle in degrees to the provided TuioPoint + + + + Returns the angle in degrees to the provided TuioPoint + + the distant TuioPoint + the angle in degrees to the provided TuioPoint + Returns the X coordinate in pixels relative to the provided screen width. @@ -870,6 +2141,27 @@ the screen height the Y coordinate of this TuioPoint in pixels relative to the provided screen height + + + Returns the Y coordinate in pixels relative to the provided screen height. + + the screen height + the Y coordinate of this TuioPoint in pixels relative to the provided screen height + + + + Returns the Y coordinate in pixels relative to the provided screen height. + + the screen height + the Y coordinate of this TuioPoint in pixels relative to the provided screen height + + + + Returns the Y coordinate in pixels relative to the provided screen height. + + the screen height + the Y coordinate of this TuioPoint in pixels relative to the provided screen height + Returns the time stamp of this TuioPoint as TuioTime. @@ -1054,6 +2346,10 @@ Defines the ROTATING state. + + + Defines the RESIZED state. + This constructor takes a TuioTime argument and assigns it along with the provided From 33bd6826f98e7b67faaf7196f62140bcd7751bae Mon Sep 17 00:00:00 2001 From: nickos64252 Date: Tue, 22 Nov 2022 16:56:50 +0100 Subject: [PATCH 2/2] Licence correction --- TUIO/TuioBlob25D.cs | 5 +++-- TUIO/TuioBlob3D.cs | 3 ++- TUIO/TuioClient.cs | 5 +++-- TUIO/TuioContainer.cs | 3 ++- TUIO/TuioCursor.cs | 3 ++- TUIO/TuioCursor25D.cs | 3 ++- TUIO/TuioCursor3D.cs | 3 ++- TUIO/TuioListener.cs | 5 +++-- TUIO/TuioObject.cs | 3 ++- TUIO/TuioObject25D.cs | 3 ++- TUIO/TuioObject3D.cs | 3 ++- TUIO/TuioPoint.cs | 3 ++- TuioDemo.cs | 3 ++- TuioDump.cs | 5 +++-- 14 files changed, 32 insertions(+), 18 deletions(-) diff --git a/TUIO/TuioBlob25D.cs b/TUIO/TuioBlob25D.cs index 794f1a5..3353a7f 100644 --- a/TUIO/TuioBlob25D.cs +++ b/TUIO/TuioBlob25D.cs @@ -1,6 +1,7 @@ /* - TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + TUIO C# Library - part of the reacTIVision project + Copyright (c) 2022 Nicolas Bremard + Based on TuioBlob by Martin Kaltenbrunner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/TUIO/TuioBlob3D.cs b/TUIO/TuioBlob3D.cs index f97b1fd..2a9d1e5 100644 --- a/TUIO/TuioBlob3D.cs +++ b/TUIO/TuioBlob3D.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) 2022 Nicolas Bremard + Based on TuioBlob by Martin Kaltenbrunner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/TUIO/TuioClient.cs b/TUIO/TuioClient.cs index 5a256d0..3616ed2 100644 --- a/TUIO/TuioClient.cs +++ b/TUIO/TuioClient.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) + Copyright (c) 2005-2016 Martin Kaltenbrunner + Modified by Bremard Nicolas on 11/2022 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -40,7 +41,7 @@ namespace TUIO * * * @author Martin Kaltenbrunner - * @version 1.1.6 + * @version 1.1.7 */ public class TuioClient { diff --git a/TUIO/TuioContainer.cs b/TUIO/TuioContainer.cs index 281ec03..06bf34a 100644 --- a/TUIO/TuioContainer.cs +++ b/TUIO/TuioContainer.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project Copyright (c) 2005-2016 Martin Kaltenbrunner + Modified by Bremard Nicolas on 11/2022 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -29,7 +30,7 @@ namespace TUIO * * * @author Martin Kaltenbrunner - * @version 1.1.6 + * @version 1.1.7 */ public abstract class TuioContainer : TuioPoint { diff --git a/TUIO/TuioCursor.cs b/TUIO/TuioCursor.cs index 4814f1e..344d8a6 100644 --- a/TUIO/TuioCursor.cs +++ b/TUIO/TuioCursor.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project Copyright (c) 2005-2016 Martin Kaltenbrunner +Modified by Bremard Nicolas on 11/2022 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,7 +27,7 @@ namespace TUIO * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. * * @author Martin Kaltenbrunner - * @version 1.1.6 + * @version 1.1.7 */ public class TuioCursor : TuioContainer { diff --git a/TUIO/TuioCursor25D.cs b/TUIO/TuioCursor25D.cs index 321256c..c338276 100644 --- a/TUIO/TuioCursor25D.cs +++ b/TUIO/TuioCursor25D.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) 2022 Nicolas Bremard + Based on TuioBlob by Martin Kaltenbrunner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/TUIO/TuioCursor3D.cs b/TUIO/TuioCursor3D.cs index c8b647c..cf1766d 100644 --- a/TUIO/TuioCursor3D.cs +++ b/TUIO/TuioCursor3D.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) 2022 Nicolas Bremard + Based on TuioBlob by Martin Kaltenbrunner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/TUIO/TuioListener.cs b/TUIO/TuioListener.cs index 260624b..cc5af94 100644 --- a/TUIO/TuioListener.cs +++ b/TUIO/TuioListener.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) + Copyright (c) 2005-2016 Martin Kaltenbrunner + Modified by Bremard Nicolas on 11/2022 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -41,7 +42,7 @@ namespace TUIO * * * - * @author Nicolas Bremard + * @author Martin Kaltenbrunner * @version 1.1.7 */ public interface TuioListener diff --git a/TUIO/TuioObject.cs b/TUIO/TuioObject.cs index d3f8886..6cfc33d 100644 --- a/TUIO/TuioObject.cs +++ b/TUIO/TuioObject.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project Copyright (c) 2005-2016 Martin Kaltenbrunner +Modified by Bremard Nicolas on 11/2022 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +29,7 @@ namespace TUIO * * * @author Martin Kaltenbrunner - * @version 1.1.6 + * @version 1.1.7 */ public class TuioObject : TuioContainer { diff --git a/TUIO/TuioObject25D.cs b/TUIO/TuioObject25D.cs index 95f8e18..ac164ab 100644 --- a/TUIO/TuioObject25D.cs +++ b/TUIO/TuioObject25D.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) 2022 Nicolas Bremard + Based on TuioBlob by Martin Kaltenbrunner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/TUIO/TuioObject3D.cs b/TUIO/TuioObject3D.cs index 87dcdb7..44f4714 100644 --- a/TUIO/TuioObject3D.cs +++ b/TUIO/TuioObject3D.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project - Copyright (c) 2005-2016 Martin Kaltenbrunner + Copyright (c) 2022 Nicolas Bremard + Based on TuioBlob by Martin Kaltenbrunner This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/TUIO/TuioPoint.cs b/TUIO/TuioPoint.cs index 26c84fc..c8dd52c 100644 --- a/TUIO/TuioPoint.cs +++ b/TUIO/TuioPoint.cs @@ -1,6 +1,7 @@ /* TUIO C# Library - part of the reacTIVision project Copyright (c) 2005-2016 Martin Kaltenbrunner +Modified by Bremard Nicolas on 11/2022 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,7 +27,7 @@ namespace TUIO * on the other hand the TuioPoint is the base class for the TuioCursor and TuioObject classes. * * @author Martin Kaltenbrunner - * @version 1.1.6 + * @version 1.1.7 */ public class TuioPoint { diff --git a/TuioDemo.cs b/TuioDemo.cs index 1f95ff9..96db4d8 100644 --- a/TuioDemo.cs +++ b/TuioDemo.cs @@ -1,6 +1,7 @@ /* TUIO C# Demo - part of the reacTIVision project - Copyright (c) + Copyright (c) 2005-2016 Martin Kaltenbrunner + Modified by Bremard Nicolas on 11/2022 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/TuioDump.cs b/TuioDump.cs index d7a3cd4..e693b6b 100644 --- a/TuioDump.cs +++ b/TuioDump.cs @@ -1,8 +1,9 @@ /* TUIO C# Example - part of the reacTIVision project http://reactivision.sourceforge.net/ - - Copyright (c) + + Copyright (c) 2005-2016 Martin Kaltenbrunner + Modified by Bremard Nicolas on 11/2022 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by