domInstance_controller.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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 __domInstance_controller_h__
  14. #define __domInstance_controller_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domBind_material.h>
  19. #include <dom/domExtra.h>
  20. class DAE;
  21. /**
  22. * The instance_controller element declares the instantiation of a COLLADA
  23. * controller resource.
  24. */
  25. class domInstance_controller : public daeElement
  26. {
  27. public:
  28. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_CONTROLLER; }
  29. static daeInt ID() { return 689; }
  30. virtual daeInt typeID() const { return ID(); }
  31. public:
  32. class domSkeleton;
  33. typedef daeSmartRef<domSkeleton> domSkeletonRef;
  34. typedef daeTArray<domSkeletonRef> domSkeleton_Array;
  35. /**
  36. * The skeleton element is used to indicate where a skin controller is to
  37. * start to search for the joint nodes it needs. This element is meaningless
  38. * for morph controllers.
  39. */
  40. class domSkeleton : public daeElement
  41. {
  42. public:
  43. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SKELETON; }
  44. static daeInt ID() { return 690; }
  45. virtual daeInt typeID() const { return ID(); }
  46. protected: // Value
  47. /**
  48. * The xsAnyURI value of the text data of this element.
  49. */
  50. xsAnyURI _value;
  51. public: //Accessors and Mutators
  52. /**
  53. * Gets the value of this element.
  54. * @return Returns a xsAnyURI of the value.
  55. */
  56. xsAnyURI &getValue() { return _value; }
  57. /**
  58. * Gets the value of this element.
  59. * @return Returns a constant xsAnyURI of the value.
  60. */
  61. const xsAnyURI &getValue() const { return _value; }
  62. /**
  63. * Sets the _value of this element.
  64. * @param val The new value for this element.
  65. */
  66. void setValue( const xsAnyURI &val ) { _value = val; }
  67. /**
  68. * Sets the _value of this element.
  69. * @param val The new value for this element.
  70. */
  71. void setValue( xsString val ) { _value = val; }
  72. protected:
  73. /**
  74. * Constructor
  75. */
  76. domSkeleton(DAE& dae) : daeElement(dae), _value(dae, *this) {}
  77. /**
  78. * Destructor
  79. */
  80. virtual ~domSkeleton() {}
  81. /**
  82. * Overloaded assignment operator
  83. */
  84. virtual domSkeleton &operator=( const domSkeleton &cpy ) { (void)cpy; return *this; }
  85. public: // STATIC METHODS
  86. /**
  87. * Creates an instance of this class and returns a daeElementRef referencing it.
  88. * @return a daeElementRef referencing an instance of this object.
  89. */
  90. static DLLSPEC daeElementRef create(DAE& dae);
  91. /**
  92. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  93. * If a daeMetaElement already exists it will return that instead of creating a new one.
  94. * @return A daeMetaElement describing this COLLADA element.
  95. */
  96. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  97. };
  98. protected: // Attributes
  99. /**
  100. * The url attribute refers to resource. This may refer to a local resource
  101. * using a relative URL fragment identifier that begins with the “#”
  102. * character. The url attribute may refer to an external resource using an
  103. * absolute or relative URL.
  104. */
  105. xsAnyURI attrUrl;
  106. /**
  107. * The sid attribute is a text string value containing the sub-identifier
  108. * of this element. This value must be unique within the scope of the parent
  109. * element. Optional attribute.
  110. */
  111. xsNCName attrSid;
  112. /**
  113. * The name attribute is the text string name of this element. Optional attribute.
  114. */
  115. xsNCName attrName;
  116. protected: // Elements
  117. /**
  118. * The skeleton element is used to indicate where a skin controller is to
  119. * start to search for the joint nodes it needs. This element is meaningless
  120. * for morph controllers. @see domSkeleton
  121. */
  122. domSkeleton_Array elemSkeleton_array;
  123. /**
  124. * Bind a specific material to a piece of geometry, binding varying and uniform
  125. * parameters at the same time. @see domBind_material
  126. */
  127. domBind_materialRef elemBind_material;
  128. /**
  129. * The extra element may appear any number of times. @see domExtra
  130. */
  131. domExtra_Array elemExtra_array;
  132. public: //Accessors and Mutators
  133. /**
  134. * Gets the url attribute.
  135. * @return Returns a xsAnyURI reference of the url attribute.
  136. */
  137. xsAnyURI &getUrl() { return attrUrl; }
  138. /**
  139. * Gets the url attribute.
  140. * @return Returns a constant xsAnyURI reference of the url attribute.
  141. */
  142. const xsAnyURI &getUrl() const { return attrUrl; }
  143. /**
  144. * Sets the url attribute.
  145. * @param atUrl The new value for the url attribute.
  146. */
  147. void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
  148. /**
  149. * Sets the url attribute.
  150. * @param atUrl The new value for the url attribute.
  151. */
  152. void setUrl( xsString atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
  153. /**
  154. * Gets the sid attribute.
  155. * @return Returns a xsNCName of the sid attribute.
  156. */
  157. xsNCName getSid() const { return attrSid; }
  158. /**
  159. * Sets the sid attribute.
  160. * @param atSid The new value for the sid attribute.
  161. */
  162. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; }
  163. /**
  164. * Gets the name attribute.
  165. * @return Returns a xsNCName of the name attribute.
  166. */
  167. xsNCName getName() const { return attrName; }
  168. /**
  169. * Sets the name attribute.
  170. * @param atName The new value for the name attribute.
  171. */
  172. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[2] = true; }
  173. /**
  174. * Gets the skeleton element array.
  175. * @return Returns a reference to the array of skeleton elements.
  176. */
  177. domSkeleton_Array &getSkeleton_array() { return elemSkeleton_array; }
  178. /**
  179. * Gets the skeleton element array.
  180. * @return Returns a constant reference to the array of skeleton elements.
  181. */
  182. const domSkeleton_Array &getSkeleton_array() const { return elemSkeleton_array; }
  183. /**
  184. * Gets the bind_material element.
  185. * @return a daeSmartRef to the bind_material element.
  186. */
  187. const domBind_materialRef getBind_material() const { return elemBind_material; }
  188. /**
  189. * Gets the extra element array.
  190. * @return Returns a reference to the array of extra elements.
  191. */
  192. domExtra_Array &getExtra_array() { return elemExtra_array; }
  193. /**
  194. * Gets the extra element array.
  195. * @return Returns a constant reference to the array of extra elements.
  196. */
  197. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  198. protected:
  199. /**
  200. * Constructor
  201. */
  202. domInstance_controller(DAE& dae) : daeElement(dae), attrUrl(dae, *this), attrSid(), attrName(), elemSkeleton_array(), elemBind_material(), elemExtra_array() {}
  203. /**
  204. * Destructor
  205. */
  206. virtual ~domInstance_controller() {}
  207. /**
  208. * Overloaded assignment operator
  209. */
  210. virtual domInstance_controller &operator=( const domInstance_controller &cpy ) { (void)cpy; return *this; }
  211. public: // STATIC METHODS
  212. /**
  213. * Creates an instance of this class and returns a daeElementRef referencing it.
  214. * @return a daeElementRef referencing an instance of this object.
  215. */
  216. static DLLSPEC daeElementRef create(DAE& dae);
  217. /**
  218. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  219. * If a daeMetaElement already exists it will return that instead of creating a new one.
  220. * @return A daeMetaElement describing this COLLADA element.
  221. */
  222. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  223. };
  224. #endif