TuioCursor.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. * 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):base(ttime, si,xp,yp) {
  42. cursor_id = ci;
  43. }
  44. /**
  45. * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate
  46. * and assigs these values to the newly created TuioCursor.
  47. *
  48. * @param si the Session ID to assign
  49. * @param ci the Cursor ID to assign
  50. * @param xp the X coordinate to assign
  51. * @param yp the Y coordinate to assign
  52. */
  53. public TuioCursor (long si, int ci, float xp, float yp):base(si,xp,yp) {
  54. cursor_id = ci;
  55. }
  56. /**
  57. * This constructor takes the atttibutes of the provided TuioCursor
  58. * and assigs these values to the newly created TuioCursor.
  59. *
  60. * @param tcur the TuioCursor to assign
  61. */
  62. public TuioCursor (TuioCursor tcur):base(tcur) {
  63. cursor_id = tcur.getCursorID();
  64. }
  65. /**
  66. * Returns the Cursor ID of this TuioCursor.
  67. * @return the Cursor ID of this TuioCursor
  68. */
  69. public int getCursorID() {
  70. return cursor_id;
  71. }
  72. }
  73. }