domGlsl_newparam.h 8.7 KB

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