domSpline.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 __domSpline_h__
  14. #define __domSpline_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domSource.h>
  19. #include <dom/domExtra.h>
  20. #include <dom/domInputLocal.h>
  21. class DAE;
  22. /**
  23. * The spline element contains control vertex information sufficient to describe
  24. * basic splines.
  25. */
  26. class domSpline : public daeElement
  27. {
  28. public:
  29. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SPLINE; }
  30. static daeInt ID() { return 615; }
  31. virtual daeInt typeID() const { return ID(); }
  32. public:
  33. class domControl_vertices;
  34. typedef daeSmartRef<domControl_vertices> domControl_verticesRef;
  35. typedef daeTArray<domControl_verticesRef> domControl_vertices_Array;
  36. /**
  37. * The control vertices element must occur exactly one time. It is used
  38. * to describe the CVs of the spline.
  39. */
  40. class domControl_vertices : public daeElement
  41. {
  42. public:
  43. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CONTROL_VERTICES; }
  44. static daeInt ID() { return 616; }
  45. virtual daeInt typeID() const { return ID(); }
  46. protected: // Elements
  47. /**
  48. * The input element must occur at least one time. These inputs are local
  49. * inputs. @see domInput
  50. */
  51. domInputLocal_Array elemInput_array;
  52. /**
  53. * The extra element may appear any number of times. @see domExtra
  54. */
  55. domExtra_Array elemExtra_array;
  56. public: //Accessors and Mutators
  57. /**
  58. * Gets the input element array.
  59. * @return Returns a reference to the array of input elements.
  60. */
  61. domInputLocal_Array &getInput_array() { return elemInput_array; }
  62. /**
  63. * Gets the input element array.
  64. * @return Returns a constant reference to the array of input elements.
  65. */
  66. const domInputLocal_Array &getInput_array() const { return elemInput_array; }
  67. /**
  68. * Gets the extra element array.
  69. * @return Returns a reference to the array of extra elements.
  70. */
  71. domExtra_Array &getExtra_array() { return elemExtra_array; }
  72. /**
  73. * Gets the extra element array.
  74. * @return Returns a constant reference to the array of extra elements.
  75. */
  76. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  77. protected:
  78. /**
  79. * Constructor
  80. */
  81. domControl_vertices(DAE& dae) : daeElement(dae), elemInput_array(), elemExtra_array() {}
  82. /**
  83. * Destructor
  84. */
  85. virtual ~domControl_vertices() {}
  86. /**
  87. * Overloaded assignment operator
  88. */
  89. virtual domControl_vertices &operator=( const domControl_vertices &cpy ) { (void)cpy; return *this; }
  90. public: // STATIC METHODS
  91. /**
  92. * Creates an instance of this class and returns a daeElementRef referencing it.
  93. * @return a daeElementRef referencing an instance of this object.
  94. */
  95. static DLLSPEC daeElementRef create(DAE& dae);
  96. /**
  97. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  98. * If a daeMetaElement already exists it will return that instead of creating a new one.
  99. * @return A daeMetaElement describing this COLLADA element.
  100. */
  101. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  102. };
  103. protected: // Attribute
  104. domBool attrClosed;
  105. protected: // Elements
  106. /**
  107. * The mesh element must contain one or more source elements. @see domSource
  108. */
  109. domSource_Array elemSource_array;
  110. /**
  111. * The control vertices element must occur exactly one time. It is used
  112. * to describe the CVs of the spline. @see domControl_vertices
  113. */
  114. domControl_verticesRef elemControl_vertices;
  115. /**
  116. * The extra element may appear any number of times. @see domExtra
  117. */
  118. domExtra_Array elemExtra_array;
  119. public: //Accessors and Mutators
  120. /**
  121. * Gets the closed attribute.
  122. * @return Returns a domBool of the closed attribute.
  123. */
  124. domBool getClosed() const { return attrClosed; }
  125. /**
  126. * Sets the closed attribute.
  127. * @param atClosed The new value for the closed attribute.
  128. */
  129. void setClosed( domBool atClosed ) { attrClosed = atClosed; _validAttributeArray[0] = true; }
  130. /**
  131. * Gets the source element array.
  132. * @return Returns a reference to the array of source elements.
  133. */
  134. domSource_Array &getSource_array() { return elemSource_array; }
  135. /**
  136. * Gets the source element array.
  137. * @return Returns a constant reference to the array of source elements.
  138. */
  139. const domSource_Array &getSource_array() const { return elemSource_array; }
  140. /**
  141. * Gets the control_vertices element.
  142. * @return a daeSmartRef to the control_vertices element.
  143. */
  144. const domControl_verticesRef getControl_vertices() const { return elemControl_vertices; }
  145. /**
  146. * Gets the extra element array.
  147. * @return Returns a reference to the array of extra elements.
  148. */
  149. domExtra_Array &getExtra_array() { return elemExtra_array; }
  150. /**
  151. * Gets the extra element array.
  152. * @return Returns a constant reference to the array of extra elements.
  153. */
  154. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  155. protected:
  156. /**
  157. * Constructor
  158. */
  159. domSpline(DAE& dae) : daeElement(dae), attrClosed(), elemSource_array(), elemControl_vertices(), elemExtra_array() {}
  160. /**
  161. * Destructor
  162. */
  163. virtual ~domSpline() {}
  164. /**
  165. * Overloaded assignment operator
  166. */
  167. virtual domSpline &operator=( const domSpline &cpy ) { (void)cpy; return *this; }
  168. public: // STATIC METHODS
  169. /**
  170. * Creates an instance of this class and returns a daeElementRef referencing it.
  171. * @return a daeElementRef referencing an instance of this object.
  172. */
  173. static DLLSPEC daeElementRef create(DAE& dae);
  174. /**
  175. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  176. * If a daeMetaElement already exists it will return that instead of creating a new one.
  177. * @return A daeMetaElement describing this COLLADA element.
  178. */
  179. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  180. };
  181. #endif