TuioCursor.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. TUIO C# Library - part of the reacTIVision project
  3. http://reactivision.sourceforge.net/
  4. Copyright (c) 2005-2009 Martin Kaltenbrunner <mkalten@iua.upf.edu>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. using System;
  18. namespace TUIO
  19. {
  20. /**
  21. * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.
  22. *
  23. * @author Martin Kaltenbrunner
  24. * @version 1.4
  25. */
  26. public class TuioCursor : TuioContainer
  27. {
  28. /**
  29. * The individual cursor ID number that is assigned to each TuioCursor.
  30. */
  31. protected int cursor_id;
  32. /**
  33. * This constructor takes a TuioTime argument and assigns it along with the provided
  34. * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.
  35. *
  36. * @param ttime the TuioTime to assign
  37. * @param si the Session ID to assign
  38. * @param ci the Cursor ID to assign
  39. * @param xp the X coordinate to assign
  40. * @param yp the Y coordinate to assign
  41. */
  42. public TuioCursor(TuioTime ttime, long si, int ci, float xp, float yp)
  43. : base(ttime, si, xp, yp)
  44. {
  45. cursor_id = ci;
  46. }
  47. /**
  48. * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate
  49. * and assigs these values to the newly created TuioCursor.
  50. *
  51. * @param si the Session ID to assign
  52. * @param ci the Cursor ID to assign
  53. * @param xp the X coordinate to assign
  54. * @param yp the Y coordinate to assign
  55. */
  56. public TuioCursor(long si, int ci, float xp, float yp)
  57. : base(si, xp, yp)
  58. {
  59. cursor_id = ci;
  60. }
  61. /**
  62. * This constructor takes the atttibutes of the provided TuioCursor
  63. * and assigs these values to the newly created TuioCursor.
  64. *
  65. * @param tcur the TuioCursor to assign
  66. */
  67. public TuioCursor(TuioCursor tcur)
  68. : base(tcur)
  69. {
  70. cursor_id = tcur.getCursorID();
  71. }
  72. /**
  73. * Returns the Cursor ID of this TuioCursor.
  74. * @return the Cursor ID of this TuioCursor
  75. */
  76. public int getCursorID()
  77. {
  78. return cursor_id;
  79. }
  80. }
  81. }