2
0

TuioCursor.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. TUIO C++ Library - part of the reacTIVision project
  3. http://reactivision.sourceforge.net/
  4. Copyright (c) 2005-2009 Martin Kaltenbrunner <[email protected]>
  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. #ifndef INCLUDED_TUIOCURSOR_H
  18. #define INCLUDED_TUIOCURSOR_H
  19. #include <math.h>
  20. #include "TuioContainer.h"
  21. namespace TUIO {
  22. /**
  23. * The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors.
  24. *
  25. * @author Martin Kaltenbrunner
  26. * @version 1.4
  27. */
  28. class TuioCursor: public TuioContainer {
  29. protected:
  30. /**
  31. * The individual cursor ID number that is assigned to each TuioCursor.
  32. */
  33. int cursor_id;
  34. public:
  35. /**
  36. * This constructor takes a TuioTime argument and assigns it along with the provided
  37. * Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor.
  38. *
  39. * @param ttime the TuioTime to assign
  40. * @param si the Session ID to assign
  41. * @param ci the Cursor ID to assign
  42. * @param xp the X coordinate to assign
  43. * @param yp the Y coordinate to assign
  44. */
  45. TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp):TuioContainer(ttime,si,xp,yp) {
  46. cursor_id = ci;
  47. };
  48. /**
  49. * This constructor takes the provided Session ID, Cursor ID, X and Y coordinate
  50. * and assigs these values to the newly created TuioCursor.
  51. *
  52. * @param si the Session ID to assign
  53. * @param ci the Cursor ID to assign
  54. * @param xp the X coordinate to assign
  55. * @param yp the Y coordinate to assign
  56. */
  57. TuioCursor (long si, int ci, float xp, float yp):TuioContainer(si,xp,yp) {
  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. TuioCursor (TuioCursor *tcur):TuioContainer(tcur) {
  67. cursor_id = tcur->getCursorID();
  68. };
  69. /**
  70. * The destructor is doing nothing in particular.
  71. */
  72. ~TuioCursor(){};
  73. /**
  74. * Returns the Cursor ID of this TuioCursor.
  75. * @return the Cursor ID of this TuioCursor
  76. */
  77. int getCursorID() {
  78. return cursor_id;
  79. };
  80. };
  81. };
  82. #endif