domCylinder.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 __domCylinder_h__
  14. #define __domCylinder_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 cylinder primitive that is centered on, and aligned with. the local Y
  22. * axis.
  23. */
  24. class domCylinder : public daeElement
  25. {
  26. public:
  27. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CYLINDER; }
  28. static daeInt ID() { return 775; }
  29. virtual daeInt typeID() const { return ID(); }
  30. public:
  31. class domHeight;
  32. typedef daeSmartRef<domHeight> domHeightRef;
  33. typedef daeTArray<domHeightRef> domHeight_Array;
  34. /**
  35. * A float value that represents the length of the cylinder along the Y axis.
  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 776; }
  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. * float2 values that represent the radii of the cylinder.
  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 777; }
  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 cylinder along the Y axis.
  147. * @see domHeight
  148. */
  149. domHeightRef elemHeight;
  150. /**
  151. * float2 values that represent the radii of the cylinder. @see domRadius
  152. */
  153. domRadiusRef elemRadius;
  154. /**
  155. * The extra element may appear any number of times. @see domExtra
  156. */
  157. domExtra_Array elemExtra_array;
  158. public: //Accessors and Mutators
  159. /**
  160. * Gets the height element.
  161. * @return a daeSmartRef to the height element.
  162. */
  163. const domHeightRef getHeight() const { return elemHeight; }
  164. /**
  165. * Gets the radius element.
  166. * @return a daeSmartRef to the radius element.
  167. */
  168. const domRadiusRef getRadius() const { return elemRadius; }
  169. /**
  170. * Gets the extra element array.
  171. * @return Returns a reference to the array of extra elements.
  172. */
  173. domExtra_Array &getExtra_array() { return elemExtra_array; }
  174. /**
  175. * Gets the extra element array.
  176. * @return Returns a constant reference to the array of extra elements.
  177. */
  178. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  179. protected:
  180. /**
  181. * Constructor
  182. */
  183. domCylinder(DAE& dae) : daeElement(dae), elemHeight(), elemRadius(), elemExtra_array() {}
  184. /**
  185. * Destructor
  186. */
  187. virtual ~domCylinder() {}
  188. /**
  189. * Overloaded assignment operator
  190. */
  191. virtual domCylinder &operator=( const domCylinder &cpy ) { (void)cpy; return *this; }
  192. public: // STATIC METHODS
  193. /**
  194. * Creates an instance of this class and returns a daeElementRef referencing it.
  195. * @return a daeElementRef referencing an instance of this object.
  196. */
  197. static DLLSPEC daeElementRef create(DAE& dae);
  198. /**
  199. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  200. * If a daeMetaElement already exists it will return that instead of creating a new one.
  201. * @return A daeMetaElement describing this COLLADA element.
  202. */
  203. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  204. };
  205. #endif