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. namespace TUIO
  18. {
  19. /**
  20. * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.
  21. *
  22. * @author Martin Kaltenbrunner
  23. * @version 1.4
  24. */
  25. public class TuioCursor : TuioContainer
  26. {
  27. /**
  28. * The individual cursor ID number that is assigned to each TuioCursor.
  29. */
  30. protected int cursor_id;
  31. /**
  32. * This constructor takes a TuioTime argument and assigns it along with the provided
  33. * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.
  34. *
  35. * @param ttime the TuioTime to assign
  36. * @param si the Session ID to assign
  37. * @param ci the Cursor ID to assign
  38. * @param xp the X coordinate to assign
  39. * @param yp the Y coordinate to assign
  40. */
  41. public TuioCursor(TuioTime ttime, long si, int ci, float xp, float yp)
  42. : base(ttime, si, xp, yp)
  43. {
  44. cursor_id = ci;
  45. }
  46. /**
  47. * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate
  48. * and assigs these values to the newly created TuioCursor.
  49. *
  50. * @param si the Session ID to assign
  51. * @param ci the Cursor ID to assign
  52. * @param xp the X coordinate to assign
  53. * @param yp the Y coordinate to assign
  54. */
  55. public TuioCursor(long si, int ci, float xp, float yp)
  56. : base(si, xp, yp)
  57. {
  58. cursor_id = ci;
  59. }
  60. /**
  61. * This constructor takes the atttibutes of the provided TuioCursor
  62. * and assigs these values to the newly created TuioCursor.
  63. *
  64. * @param tcur the TuioCursor to assign
  65. */
  66. public TuioCursor(TuioCursor tcur)
  67. : base(tcur)
  68. {
  69. cursor_id = tcur.getCursorID();
  70. }
  71. /**
  72. * Returns the Cursor ID of this TuioCursor.
  73. * @return the Cursor ID of this TuioCursor
  74. */
  75. public int getCursorID()
  76. {
  77. return cursor_id;
  78. }
  79. }
  80. }