/src/org/mt4j/input/inputProcessors/componentProcessors/rotateProcessor/RotateEvent.java

http://mt4j.googlecode.com/ · Java · 163 lines · 51 code · 24 blank · 88 comment · 0 complexity · 14ad8d7fd5b5675c974dd38536631850 MD5 · raw file

  1. /***********************************************************************
  2. * mt4j Copyright (c) 2008 - 2009, C.Ruff, Fraunhofer-Gesellschaft All rights reserved.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  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. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. ***********************************************************************/
  18. package org.mt4j.input.inputProcessors.componentProcessors.rotateProcessor;
  19. import org.mt4j.components.interfaces.IMTComponent3D;
  20. import org.mt4j.input.inputData.InputCursor;
  21. import org.mt4j.input.inputProcessors.IInputProcessor;
  22. import org.mt4j.input.inputProcessors.MTGestureEvent;
  23. import org.mt4j.util.math.Vector3D;
  24. /**
  25. * The Class RotateEvent.
  26. * @author Christopher Ruff
  27. */
  28. public class RotateEvent extends MTGestureEvent {
  29. /** The first finger motion. */
  30. private InputCursor firstFingerMotion;
  31. /** The second finger motion. */
  32. private InputCursor secondFingerMotion;
  33. /** The rotation point. */
  34. private Vector3D rotationPoint;
  35. /** The translation vector. */
  36. private Vector3D translationVector;
  37. /** The rotation degrees. */
  38. private float rotationDegrees;
  39. /**
  40. * Instantiates a new rotate event.
  41. *
  42. * @param source the source
  43. * @param id the id
  44. * @param targetComponent the target component
  45. * @param firstFingerMotion the first finger motion
  46. * @param secondFingerMotion the second finger motion
  47. * @param translationVector the translation vector
  48. * @param rotationPoint the rotation point
  49. * @param rotationDegrees the rotation degrees
  50. */
  51. public RotateEvent(IInputProcessor source, int id, IMTComponent3D targetComponent, InputCursor firstFingerMotion, InputCursor secondFingerMotion, Vector3D translationVector, Vector3D rotationPoint, float rotationDegrees) {
  52. super(source, id, targetComponent);
  53. this.firstFingerMotion = firstFingerMotion;
  54. this.secondFingerMotion = secondFingerMotion;
  55. this.translationVector = translationVector;
  56. this.rotationPoint = rotationPoint;
  57. this.rotationDegrees = rotationDegrees;
  58. }
  59. /**
  60. * Gets the first finger motion.
  61. *
  62. * @return the first finger motion
  63. */
  64. public InputCursor getFirstCursor() {
  65. return firstFingerMotion;
  66. }
  67. /**
  68. * Gets the rotation point.
  69. *
  70. * @return the rotation point
  71. */
  72. public Vector3D getRotationPoint() {
  73. return rotationPoint;
  74. }
  75. /**
  76. * Gets the second finger motion.
  77. *
  78. * @return the second finger motion
  79. */
  80. public InputCursor getSecondCursor() {
  81. return secondFingerMotion;
  82. }
  83. /**
  84. * Gets the translation vector.
  85. *
  86. * @return the translation vector
  87. */
  88. public Vector3D getTranslationVector() {
  89. return translationVector;
  90. }
  91. /**
  92. * Gets the rotation degrees.
  93. *
  94. * @return the rotation degrees
  95. */
  96. public float getRotationDegrees() {
  97. return rotationDegrees;
  98. }
  99. /**
  100. * Sets the first finger motion.
  101. *
  102. * @param firstFingerMotion the new first finger motion
  103. */
  104. public void setFirstCursor(InputCursor firstFingerMotion) {
  105. this.firstFingerMotion = firstFingerMotion;
  106. }
  107. /**
  108. * Sets the rotation degrees.
  109. *
  110. * @param rotationDegrees the new rotation degrees
  111. */
  112. public void setRotationDegrees(float rotationDegrees) {
  113. this.rotationDegrees = rotationDegrees;
  114. }
  115. /**
  116. * Sets the rotation point.
  117. *
  118. * @param rotationPoint the new rotation point
  119. */
  120. public void setRotationPoint(Vector3D rotationPoint) {
  121. this.rotationPoint = rotationPoint;
  122. }
  123. /**
  124. * Sets the second finger motion.
  125. *
  126. * @param secondFingerMotion the new second finger motion
  127. */
  128. public void setSecondCursor(InputCursor secondFingerMotion) {
  129. this.secondFingerMotion = secondFingerMotion;
  130. }
  131. /**
  132. * Sets the translation vector.
  133. *
  134. * @param translationVector the new translation vector
  135. */
  136. public void setTranslationVector(Vector3D translationVector) {
  137. this.translationVector = translationVector;
  138. }
  139. }