domInstance_material.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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_material_h__
  14. #define __domInstance_material_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. * The instance_material element declares the instantiation of a COLLADA material
  22. * resource.
  23. */
  24. class domInstance_material : public daeElement
  25. {
  26. public:
  27. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_MATERIAL; }
  28. static daeInt ID() { return 697; }
  29. virtual daeInt typeID() const { return ID(); }
  30. public:
  31. class domBind;
  32. typedef daeSmartRef<domBind> domBindRef;
  33. typedef daeTArray<domBindRef> domBind_Array;
  34. /**
  35. * The bind element binds values to effect parameters upon instantiation.
  36. */
  37. class domBind : public daeElement
  38. {
  39. public:
  40. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND; }
  41. static daeInt ID() { return 698; }
  42. virtual daeInt typeID() const { return ID(); }
  43. protected: // Attributes
  44. /**
  45. * The semantic attribute specifies which effect parameter to bind.
  46. */
  47. xsNCName attrSemantic;
  48. /**
  49. * The target attribute specifies the location of the value to bind to the
  50. * specified semantic. This text string is a path-name following a simple
  51. * syntax described in the “Addressing Syntax” section.
  52. */
  53. xsToken attrTarget;
  54. public: //Accessors and Mutators
  55. /**
  56. * Gets the semantic attribute.
  57. * @return Returns a xsNCName of the semantic attribute.
  58. */
  59. xsNCName getSemantic() const { return attrSemantic; }
  60. /**
  61. * Sets the semantic attribute.
  62. * @param atSemantic The new value for the semantic attribute.
  63. */
  64. void setSemantic( xsNCName atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[0] = true; }
  65. /**
  66. * Gets the target attribute.
  67. * @return Returns a xsToken of the target attribute.
  68. */
  69. xsToken getTarget() const { return attrTarget; }
  70. /**
  71. * Sets the target attribute.
  72. * @param atTarget The new value for the target attribute.
  73. */
  74. void setTarget( xsToken atTarget ) { *(daeStringRef*)&attrTarget = atTarget; _validAttributeArray[1] = true; }
  75. protected:
  76. /**
  77. * Constructor
  78. */
  79. domBind(DAE& dae) : daeElement(dae), attrSemantic(), attrTarget() {}
  80. /**
  81. * Destructor
  82. */
  83. virtual ~domBind() {}
  84. /**
  85. * Overloaded assignment operator
  86. */
  87. virtual domBind &operator=( const domBind &cpy ) { (void)cpy; return *this; }
  88. public: // STATIC METHODS
  89. /**
  90. * Creates an instance of this class and returns a daeElementRef referencing it.
  91. * @return a daeElementRef referencing an instance of this object.
  92. */
  93. static DLLSPEC daeElementRef create(DAE& dae);
  94. /**
  95. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  96. * If a daeMetaElement already exists it will return that instead of creating a new one.
  97. * @return A daeMetaElement describing this COLLADA element.
  98. */
  99. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  100. };
  101. class domBind_vertex_input;
  102. typedef daeSmartRef<domBind_vertex_input> domBind_vertex_inputRef;
  103. typedef daeTArray<domBind_vertex_inputRef> domBind_vertex_input_Array;
  104. /**
  105. * The bind_vertex_input element binds vertex inputs to effect parameters
  106. * upon instantiation.
  107. */
  108. class domBind_vertex_input : public daeElement
  109. {
  110. public:
  111. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND_VERTEX_INPUT; }
  112. static daeInt ID() { return 699; }
  113. virtual daeInt typeID() const { return ID(); }
  114. protected: // Attributes
  115. /**
  116. * The semantic attribute specifies which effect parameter to bind.
  117. */
  118. xsNCName attrSemantic;
  119. /**
  120. * The input_semantic attribute specifies which input semantic to bind.
  121. */
  122. xsNCName attrInput_semantic;
  123. /**
  124. * The input_set attribute specifies which input set to bind.
  125. */
  126. domUint attrInput_set;
  127. public: //Accessors and Mutators
  128. /**
  129. * Gets the semantic attribute.
  130. * @return Returns a xsNCName of the semantic attribute.
  131. */
  132. xsNCName getSemantic() const { return attrSemantic; }
  133. /**
  134. * Sets the semantic attribute.
  135. * @param atSemantic The new value for the semantic attribute.
  136. */
  137. void setSemantic( xsNCName atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[0] = true; }
  138. /**
  139. * Gets the input_semantic attribute.
  140. * @return Returns a xsNCName of the input_semantic attribute.
  141. */
  142. xsNCName getInput_semantic() const { return attrInput_semantic; }
  143. /**
  144. * Sets the input_semantic attribute.
  145. * @param atInput_semantic The new value for the input_semantic attribute.
  146. */
  147. void setInput_semantic( xsNCName atInput_semantic ) { *(daeStringRef*)&attrInput_semantic = atInput_semantic; _validAttributeArray[1] = true; }
  148. /**
  149. * Gets the input_set attribute.
  150. * @return Returns a domUint of the input_set attribute.
  151. */
  152. domUint getInput_set() const { return attrInput_set; }
  153. /**
  154. * Sets the input_set attribute.
  155. * @param atInput_set The new value for the input_set attribute.
  156. */
  157. void setInput_set( domUint atInput_set ) { attrInput_set = atInput_set; _validAttributeArray[2] = true; }
  158. protected:
  159. /**
  160. * Constructor
  161. */
  162. domBind_vertex_input(DAE& dae) : daeElement(dae), attrSemantic(), attrInput_semantic(), attrInput_set() {}
  163. /**
  164. * Destructor
  165. */
  166. virtual ~domBind_vertex_input() {}
  167. /**
  168. * Overloaded assignment operator
  169. */
  170. virtual domBind_vertex_input &operator=( const domBind_vertex_input &cpy ) { (void)cpy; return *this; }
  171. public: // STATIC METHODS
  172. /**
  173. * Creates an instance of this class and returns a daeElementRef referencing it.
  174. * @return a daeElementRef referencing an instance of this object.
  175. */
  176. static DLLSPEC daeElementRef create(DAE& dae);
  177. /**
  178. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  179. * If a daeMetaElement already exists it will return that instead of creating a new one.
  180. * @return A daeMetaElement describing this COLLADA element.
  181. */
  182. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  183. };
  184. protected: // Attributes
  185. /**
  186. * The symbol attribute specifies which symbol defined from within the geometry
  187. * this material binds to.
  188. */
  189. xsNCName attrSymbol;
  190. /**
  191. * The target attribute specifies the URL of the location of the object to
  192. * instantiate.
  193. */
  194. xsAnyURI attrTarget;
  195. /**
  196. * The sid attribute is a text string value containing the sub-identifier
  197. * of this element. This value must be unique within the scope of the parent
  198. * element. Optional attribute.
  199. */
  200. xsNCName attrSid;
  201. /**
  202. * The name attribute is the text string name of this element. Optional attribute.
  203. */
  204. xsNCName attrName;
  205. protected: // Elements
  206. /**
  207. * The bind element binds values to effect parameters upon instantiation.
  208. * @see domBind
  209. */
  210. domBind_Array elemBind_array;
  211. /**
  212. * The bind_vertex_input element binds vertex inputs to effect parameters
  213. * upon instantiation. @see domBind_vertex_input
  214. */
  215. domBind_vertex_input_Array elemBind_vertex_input_array;
  216. /**
  217. * The extra element may appear any number of times. @see domExtra
  218. */
  219. domExtra_Array elemExtra_array;
  220. public: //Accessors and Mutators
  221. /**
  222. * Gets the symbol attribute.
  223. * @return Returns a xsNCName of the symbol attribute.
  224. */
  225. xsNCName getSymbol() const { return attrSymbol; }
  226. /**
  227. * Sets the symbol attribute.
  228. * @param atSymbol The new value for the symbol attribute.
  229. */
  230. void setSymbol( xsNCName atSymbol ) { *(daeStringRef*)&attrSymbol = atSymbol; _validAttributeArray[0] = true; }
  231. /**
  232. * Gets the target attribute.
  233. * @return Returns a xsAnyURI reference of the target attribute.
  234. */
  235. xsAnyURI &getTarget() { return attrTarget; }
  236. /**
  237. * Gets the target attribute.
  238. * @return Returns a constant xsAnyURI reference of the target attribute.
  239. */
  240. const xsAnyURI &getTarget() const { return attrTarget; }
  241. /**
  242. * Sets the target attribute.
  243. * @param atTarget The new value for the target attribute.
  244. */
  245. void setTarget( const xsAnyURI &atTarget ) { attrTarget = atTarget; _validAttributeArray[1] = true; }
  246. /**
  247. * Sets the target attribute.
  248. * @param atTarget The new value for the target attribute.
  249. */
  250. void setTarget( xsString atTarget ) { attrTarget = atTarget; _validAttributeArray[1] = true; }
  251. /**
  252. * Gets the sid attribute.
  253. * @return Returns a xsNCName of the sid attribute.
  254. */
  255. xsNCName getSid() const { return attrSid; }
  256. /**
  257. * Sets the sid attribute.
  258. * @param atSid The new value for the sid attribute.
  259. */
  260. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[2] = true; }
  261. /**
  262. * Gets the name attribute.
  263. * @return Returns a xsNCName of the name attribute.
  264. */
  265. xsNCName getName() const { return attrName; }
  266. /**
  267. * Sets the name attribute.
  268. * @param atName The new value for the name attribute.
  269. */
  270. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[3] = true; }
  271. /**
  272. * Gets the bind element array.
  273. * @return Returns a reference to the array of bind elements.
  274. */
  275. domBind_Array &getBind_array() { return elemBind_array; }
  276. /**
  277. * Gets the bind element array.
  278. * @return Returns a constant reference to the array of bind elements.
  279. */
  280. const domBind_Array &getBind_array() const { return elemBind_array; }
  281. /**
  282. * Gets the bind_vertex_input element array.
  283. * @return Returns a reference to the array of bind_vertex_input elements.
  284. */
  285. domBind_vertex_input_Array &getBind_vertex_input_array() { return elemBind_vertex_input_array; }
  286. /**
  287. * Gets the bind_vertex_input element array.
  288. * @return Returns a constant reference to the array of bind_vertex_input elements.
  289. */
  290. const domBind_vertex_input_Array &getBind_vertex_input_array() const { return elemBind_vertex_input_array; }
  291. /**
  292. * Gets the extra element array.
  293. * @return Returns a reference to the array of extra elements.
  294. */
  295. domExtra_Array &getExtra_array() { return elemExtra_array; }
  296. /**
  297. * Gets the extra element array.
  298. * @return Returns a constant reference to the array of extra elements.
  299. */
  300. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  301. protected:
  302. /**
  303. * Constructor
  304. */
  305. domInstance_material(DAE& dae) : daeElement(dae), attrSymbol(), attrTarget(dae, *this), attrSid(), attrName(), elemBind_array(), elemBind_vertex_input_array(), elemExtra_array() {}
  306. /**
  307. * Destructor
  308. */
  309. virtual ~domInstance_material() {}
  310. /**
  311. * Overloaded assignment operator
  312. */
  313. virtual domInstance_material &operator=( const domInstance_material &cpy ) { (void)cpy; return *this; }
  314. public: // STATIC METHODS
  315. /**
  316. * Creates an instance of this class and returns a daeElementRef referencing it.
  317. * @return a daeElementRef referencing an instance of this object.
  318. */
  319. static DLLSPEC daeElementRef create(DAE& dae);
  320. /**
  321. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  322. * If a daeMetaElement already exists it will return that instead of creating a new one.
  323. * @return A daeMetaElement describing this COLLADA element.
  324. */
  325. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  326. };
  327. #endif