domCg_newparam.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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 __domCg_newparam_h__
  14. #define __domCg_newparam_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domCg_param_type.h>
  19. #include <dom/domFx_annotate_common.h>
  20. #include <dom/domCg_setuser_type.h>
  21. #include <dom/domCg_newarray_type.h>
  22. class DAE;
  23. /**
  24. * Create a new, named param object in the CG Runtime, assign it a type, an
  25. * initial value, and additional attributes at declaration time.
  26. */
  27. class domCg_newparam_complexType
  28. {
  29. public:
  30. class domSemantic;
  31. typedef daeSmartRef<domSemantic> domSemanticRef;
  32. typedef daeTArray<domSemanticRef> domSemantic_Array;
  33. /**
  34. * The semantic element allows you to specify a semantic for this new param.
  35. */
  36. class domSemantic : public daeElement
  37. {
  38. public:
  39. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SEMANTIC; }
  40. static daeInt ID() { return 140; }
  41. virtual daeInt typeID() const { return ID(); }
  42. protected: // Value
  43. /**
  44. * The xsNCName value of the text data of this element.
  45. */
  46. xsNCName _value;
  47. public: //Accessors and Mutators
  48. /**
  49. * Gets the value of this element.
  50. * @return Returns a xsNCName of the value.
  51. */
  52. xsNCName getValue() const { return _value; }
  53. /**
  54. * Sets the _value of this element.
  55. * @param val The new value for this element.
  56. */
  57. void setValue( xsNCName val ) { *(daeStringRef*)&_value = val; }
  58. protected:
  59. /**
  60. * Constructor
  61. */
  62. domSemantic(DAE& dae) : daeElement(dae), _value() {}
  63. /**
  64. * Destructor
  65. */
  66. virtual ~domSemantic() {}
  67. /**
  68. * Overloaded assignment operator
  69. */
  70. virtual domSemantic &operator=( const domSemantic &cpy ) { (void)cpy; return *this; }
  71. public: // STATIC METHODS
  72. /**
  73. * Creates an instance of this class and returns a daeElementRef referencing it.
  74. * @return a daeElementRef referencing an instance of this object.
  75. */
  76. static DLLSPEC daeElementRef create(DAE& dae);
  77. /**
  78. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  79. * If a daeMetaElement already exists it will return that instead of creating a new one.
  80. * @return A daeMetaElement describing this COLLADA element.
  81. */
  82. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  83. };
  84. class domModifier;
  85. typedef daeSmartRef<domModifier> domModifierRef;
  86. typedef daeTArray<domModifierRef> domModifier_Array;
  87. /**
  88. * The modifier element allows you to specify a modifier for this new param.
  89. */
  90. class domModifier : public daeElement
  91. {
  92. public:
  93. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::MODIFIER; }
  94. static daeInt ID() { return 141; }
  95. virtual daeInt typeID() const { return ID(); }
  96. protected: // Value
  97. /**
  98. * The domFx_modifier_enum_common value of the text data of this element.
  99. */
  100. domFx_modifier_enum_common _value;
  101. public: //Accessors and Mutators
  102. /**
  103. * Gets the value of this element.
  104. * @return a domFx_modifier_enum_common of the value.
  105. */
  106. domFx_modifier_enum_common getValue() const { return _value; }
  107. /**
  108. * Sets the _value of this element.
  109. * @param val The new value for this element.
  110. */
  111. void setValue( domFx_modifier_enum_common val ) { _value = val; }
  112. protected:
  113. /**
  114. * Constructor
  115. */
  116. domModifier(DAE& dae) : daeElement(dae), _value() {}
  117. /**
  118. * Destructor
  119. */
  120. virtual ~domModifier() {}
  121. /**
  122. * Overloaded assignment operator
  123. */
  124. virtual domModifier &operator=( const domModifier &cpy ) { (void)cpy; return *this; }
  125. public: // STATIC METHODS
  126. /**
  127. * Creates an instance of this class and returns a daeElementRef referencing it.
  128. * @return a daeElementRef referencing an instance of this object.
  129. */
  130. static DLLSPEC daeElementRef create(DAE& dae);
  131. /**
  132. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  133. * If a daeMetaElement already exists it will return that instead of creating a new one.
  134. * @return A daeMetaElement describing this COLLADA element.
  135. */
  136. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  137. };
  138. protected: // Attribute
  139. domCg_identifier attrSid;
  140. protected: // Elements
  141. /**
  142. * The annotate element allows you to specify an annotation for this new param.
  143. * @see domAnnotate
  144. */
  145. domFx_annotate_common_Array elemAnnotate_array;
  146. /**
  147. * The semantic element allows you to specify a semantic for this new param.
  148. * @see domSemantic
  149. */
  150. domSemanticRef elemSemantic;
  151. /**
  152. * The modifier element allows you to specify a modifier for this new param.
  153. * @see domModifier
  154. */
  155. domModifierRef elemModifier;
  156. domCg_param_typeRef elemCg_param_type;
  157. domCg_setuser_typeRef elemUsertype;
  158. domCg_newarray_typeRef elemArray;
  159. /**
  160. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  161. */
  162. daeElementRefArray _contents;
  163. /**
  164. * Used to preserve order in elements that have a complex content model.
  165. */
  166. daeUIntArray _contentsOrder;
  167. /**
  168. * Used to store information needed for some content model objects.
  169. */
  170. daeTArray< daeCharArray * > _CMData;
  171. public: //Accessors and Mutators
  172. /**
  173. * Gets the sid attribute.
  174. * @return Returns a domCg_identifier of the sid attribute.
  175. */
  176. domCg_identifier getSid() const { return attrSid; }
  177. /**
  178. * Sets the sid attribute.
  179. * @param atSid The new value for the sid attribute.
  180. */
  181. void setSid( domCg_identifier atSid ) { attrSid = atSid; }
  182. /**
  183. * Gets the annotate element array.
  184. * @return Returns a reference to the array of annotate elements.
  185. */
  186. domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; }
  187. /**
  188. * Gets the annotate element array.
  189. * @return Returns a constant reference to the array of annotate elements.
  190. */
  191. const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; }
  192. /**
  193. * Gets the semantic element.
  194. * @return a daeSmartRef to the semantic element.
  195. */
  196. const domSemanticRef getSemantic() const { return elemSemantic; }
  197. /**
  198. * Gets the modifier element.
  199. * @return a daeSmartRef to the modifier element.
  200. */
  201. const domModifierRef getModifier() const { return elemModifier; }
  202. /**
  203. * Gets the cg_param_type element.
  204. * @return a daeSmartRef to the cg_param_type element.
  205. */
  206. const domCg_param_typeRef getCg_param_type() const { return elemCg_param_type; }
  207. /**
  208. * Gets the usertype element.
  209. * @return a daeSmartRef to the usertype element.
  210. */
  211. const domCg_setuser_typeRef getUsertype() const { return elemUsertype; }
  212. /**
  213. * Gets the array element.
  214. * @return a daeSmartRef to the array element.
  215. */
  216. const domCg_newarray_typeRef getArray() const { return elemArray; }
  217. /**
  218. * Gets the _contents array.
  219. * @return Returns a reference to the _contents element array.
  220. */
  221. daeElementRefArray &getContents() { return _contents; }
  222. /**
  223. * Gets the _contents array.
  224. * @return Returns a constant reference to the _contents element array.
  225. */
  226. const daeElementRefArray &getContents() const { return _contents; }
  227. protected:
  228. /**
  229. * Constructor
  230. */
  231. domCg_newparam_complexType(DAE& dae, daeElement* elt) : attrSid(), elemAnnotate_array(), elemSemantic(), elemModifier(), elemCg_param_type(), elemUsertype(), elemArray() {}
  232. /**
  233. * Destructor
  234. */
  235. virtual ~domCg_newparam_complexType() { daeElement::deleteCMDataArray(_CMData); }
  236. /**
  237. * Overloaded assignment operator
  238. */
  239. virtual domCg_newparam_complexType &operator=( const domCg_newparam_complexType &cpy ) { (void)cpy; return *this; }
  240. };
  241. /**
  242. * An element of type domCg_newparam_complexType.
  243. */
  244. class domCg_newparam : public daeElement, public domCg_newparam_complexType
  245. {
  246. public:
  247. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CG_NEWPARAM; }
  248. static daeInt ID() { return 142; }
  249. virtual daeInt typeID() const { return ID(); }
  250. public: //Accessors and Mutators
  251. /**
  252. * Gets the sid attribute.
  253. * @return Returns a domCg_identifier of the sid attribute.
  254. */
  255. domCg_identifier getSid() const { return attrSid; }
  256. /**
  257. * Sets the sid attribute.
  258. * @param atSid The new value for the sid attribute.
  259. */
  260. void setSid( domCg_identifier atSid ) { attrSid = atSid; _validAttributeArray[0] = true; }
  261. protected:
  262. /**
  263. * Constructor
  264. */
  265. domCg_newparam(DAE& dae) : daeElement(dae), domCg_newparam_complexType(dae, this) {}
  266. /**
  267. * Destructor
  268. */
  269. virtual ~domCg_newparam() {}
  270. /**
  271. * Overloaded assignment operator
  272. */
  273. virtual domCg_newparam &operator=( const domCg_newparam &cpy ) { (void)cpy; return *this; }
  274. public: // STATIC METHODS
  275. /**
  276. * Creates an instance of this class and returns a daeElementRef referencing it.
  277. * @return a daeElementRef referencing an instance of this object.
  278. */
  279. static DLLSPEC daeElementRef create(DAE& dae);
  280. /**
  281. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  282. * If a daeMetaElement already exists it will return that instead of creating a new one.
  283. * @return A daeMetaElement describing this COLLADA element.
  284. */
  285. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  286. };
  287. #endif