domCapsule.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #ifndef __domCapsule_h__
  14. #define __domCapsule_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domExtra.h>
  19. class DAE;
  20. /**
  21. * A capsule primitive that is centered on and aligned with the local Y axis.
  22. */
  23. class domCapsule : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CAPSULE; }
  27. static daeInt ID() { return 782; }
  28. virtual daeInt typeID() const { return ID(); }
  29. public:
  30. class domHeight;
  31. typedef daeSmartRef<domHeight> domHeightRef;
  32. typedef daeTArray<domHeightRef> domHeight_Array;
  33. /**
  34. * A float value that represents the length of the line segment connecting
  35. * the centers of the capping hemispheres.
  36. */
  37. class domHeight : public daeElement
  38. {
  39. public:
  40. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::HEIGHT; }
  41. static daeInt ID() { return 783; }
  42. virtual daeInt typeID() const { return ID(); }
  43. protected: // Value
  44. /**
  45. * The domFloat value of the text data of this element.
  46. */
  47. domFloat _value;
  48. public: //Accessors and Mutators
  49. /**
  50. * Gets the value of this element.
  51. * @return a domFloat of the value.
  52. */
  53. domFloat getValue() const { return _value; }
  54. /**
  55. * Sets the _value of this element.
  56. * @param val The new value for this element.
  57. */
  58. void setValue( domFloat val ) { _value = val; }
  59. protected:
  60. /**
  61. * Constructor
  62. */
  63. domHeight(DAE& dae) : daeElement(dae), _value() {}
  64. /**
  65. * Destructor
  66. */
  67. virtual ~domHeight() {}
  68. /**
  69. * Overloaded assignment operator
  70. */
  71. virtual domHeight &operator=( const domHeight &cpy ) { (void)cpy; return *this; }
  72. public: // STATIC METHODS
  73. /**
  74. * Creates an instance of this class and returns a daeElementRef referencing it.
  75. * @return a daeElementRef referencing an instance of this object.
  76. */
  77. static DLLSPEC daeElementRef create(DAE& dae);
  78. /**
  79. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  80. * If a daeMetaElement already exists it will return that instead of creating a new one.
  81. * @return A daeMetaElement describing this COLLADA element.
  82. */
  83. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  84. };
  85. class domRadius;
  86. typedef daeSmartRef<domRadius> domRadiusRef;
  87. typedef daeTArray<domRadiusRef> domRadius_Array;
  88. /**
  89. * Two float values that represent the radii of the capsule (it may be elliptical)
  90. */
  91. class domRadius : public daeElement
  92. {
  93. public:
  94. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::RADIUS; }
  95. static daeInt ID() { return 784; }
  96. virtual daeInt typeID() const { return ID(); }
  97. protected: // Value
  98. /**
  99. * The domFloat2 value of the text data of this element.
  100. */
  101. domFloat2 _value;
  102. public: //Accessors and Mutators
  103. /**
  104. * Gets the _value array.
  105. * @return Returns a domFloat2 reference of the _value array.
  106. */
  107. domFloat2 &getValue() { return _value; }
  108. /**
  109. * Gets the _value array.
  110. * @return Returns a constant domFloat2 reference of the _value array.
  111. */
  112. const domFloat2 &getValue() const { return _value; }
  113. /**
  114. * Sets the _value array.
  115. * @param val The new value for the _value array.
  116. */
  117. void setValue( const domFloat2 &val ) { _value = val; }
  118. protected:
  119. /**
  120. * Constructor
  121. */
  122. domRadius(DAE& dae) : daeElement(dae), _value() {}
  123. /**
  124. * Destructor
  125. */
  126. virtual ~domRadius() {}
  127. /**
  128. * Overloaded assignment operator
  129. */
  130. virtual domRadius &operator=( const domRadius &cpy ) { (void)cpy; return *this; }
  131. public: // STATIC METHODS
  132. /**
  133. * Creates an instance of this class and returns a daeElementRef referencing it.
  134. * @return a daeElementRef referencing an instance of this object.
  135. */
  136. static DLLSPEC daeElementRef create(DAE& dae);
  137. /**
  138. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  139. * If a daeMetaElement already exists it will return that instead of creating a new one.
  140. * @return A daeMetaElement describing this COLLADA element.
  141. */
  142. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  143. };
  144. protected: // Elements
  145. /**
  146. * A float value that represents the length of the line segment connecting
  147. * the centers of the capping hemispheres. @see domHeight
  148. */
  149. domHeightRef elemHeight;
  150. /**
  151. * Two float values that represent the radii of the capsule (it may be elliptical)
  152. * @see domRadius
  153. */
  154. domRadiusRef elemRadius;
  155. /**
  156. * The extra element may appear any number of times. @see domExtra
  157. */
  158. domExtra_Array elemExtra_array;
  159. public: //Accessors and Mutators
  160. /**
  161. * Gets the height element.
  162. * @return a daeSmartRef to the height element.
  163. */
  164. const domHeightRef getHeight() const { return elemHeight; }
  165. /**
  166. * Gets the radius element.
  167. * @return a daeSmartRef to the radius element.
  168. */
  169. const domRadiusRef getRadius() const { return elemRadius; }
  170. /**
  171. * Gets the extra element array.
  172. * @return Returns a reference to the array of extra elements.
  173. */
  174. domExtra_Array &getExtra_array() { return elemExtra_array; }
  175. /**
  176. * Gets the extra element array.
  177. * @return Returns a constant reference to the array of extra elements.
  178. */
  179. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  180. protected:
  181. /**
  182. * Constructor
  183. */
  184. domCapsule(DAE& dae) : daeElement(dae), elemHeight(), elemRadius(), elemExtra_array() {}
  185. /**
  186. * Destructor
  187. */
  188. virtual ~domCapsule() {}
  189. /**
  190. * Overloaded assignment operator
  191. */
  192. virtual domCapsule &operator=( const domCapsule &cpy ) { (void)cpy; return *this; }
  193. public: // STATIC METHODS
  194. /**
  195. * Creates an instance of this class and returns a daeElementRef referencing it.
  196. * @return a daeElementRef referencing an instance of this object.
  197. */
  198. static DLLSPEC daeElementRef create(DAE& dae);
  199. /**
  200. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  201. * If a daeMetaElement already exists it will return that instead of creating a new one.
  202. * @return A daeMetaElement describing this COLLADA element.
  203. */
  204. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  205. };
  206. #endif