domProfile_CG.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  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 __domProfile_CG_h__
  14. #define __domProfile_CG_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domFx_profile_abstract.h>
  19. #include <dom/domAsset.h>
  20. #include <dom/domImage.h>
  21. #include <dom/domExtra.h>
  22. #include <dom/domFx_code_profile.h>
  23. #include <dom/domFx_include_common.h>
  24. #include <dom/domCg_newparam.h>
  25. #include <dom/domFx_annotate_common.h>
  26. #include <dom/domCg_setparam.h>
  27. #include <dom/domGl_pipeline_settings.h>
  28. #include <dom/domFx_colortarget_common.h>
  29. #include <dom/domFx_depthtarget_common.h>
  30. #include <dom/domFx_stenciltarget_common.h>
  31. #include <dom/domFx_clearcolor_common.h>
  32. #include <dom/domFx_cleardepth_common.h>
  33. #include <dom/domFx_clearstencil_common.h>
  34. #include <dom/domCg_param_type.h>
  35. class DAE;
  36. /**
  37. * Opens a block of CG platform-specific data types and technique declarations.
  38. */
  39. class domProfile_CG : public domFx_profile_abstract
  40. {
  41. public:
  42. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PROFILE_CG; }
  43. static daeInt ID() { return 746; }
  44. virtual daeInt typeID() const { return ID(); }
  45. public:
  46. class domTechnique;
  47. typedef daeSmartRef<domTechnique> domTechniqueRef;
  48. typedef daeTArray<domTechniqueRef> domTechnique_Array;
  49. /**
  50. * Holds a description of the textures, samplers, shaders, parameters, and
  51. * passes necessary for rendering this effect using one method.
  52. */
  53. class domTechnique : public daeElement
  54. {
  55. public:
  56. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE; }
  57. static daeInt ID() { return 747; }
  58. virtual daeInt typeID() const { return ID(); }
  59. public:
  60. class domPass;
  61. typedef daeSmartRef<domPass> domPassRef;
  62. typedef daeTArray<domPassRef> domPass_Array;
  63. /**
  64. * A static declaration of all the render states, shaders, and settings for
  65. * one rendering pipeline.
  66. */
  67. class domPass : public daeElement
  68. {
  69. public:
  70. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PASS; }
  71. static daeInt ID() { return 748; }
  72. virtual daeInt typeID() const { return ID(); }
  73. public:
  74. class domDraw;
  75. typedef daeSmartRef<domDraw> domDrawRef;
  76. typedef daeTArray<domDrawRef> domDraw_Array;
  77. class domDraw : public daeElement
  78. {
  79. public:
  80. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::DRAW; }
  81. static daeInt ID() { return 749; }
  82. virtual daeInt typeID() const { return ID(); }
  83. protected: // Value
  84. /**
  85. * The domFx_draw_common value of the text data of this element.
  86. */
  87. domFx_draw_common _value;
  88. public: //Accessors and Mutators
  89. /**
  90. * Gets the value of this element.
  91. * @return a domFx_draw_common of the value.
  92. */
  93. domFx_draw_common getValue() const { return _value; }
  94. /**
  95. * Sets the _value of this element.
  96. * @param val The new value for this element.
  97. */
  98. void setValue( domFx_draw_common val ) { _value = val; }
  99. protected:
  100. /**
  101. * Constructor
  102. */
  103. domDraw(DAE& dae) : daeElement(dae), _value() {}
  104. /**
  105. * Destructor
  106. */
  107. virtual ~domDraw() {}
  108. /**
  109. * Overloaded assignment operator
  110. */
  111. virtual domDraw &operator=( const domDraw &cpy ) { (void)cpy; return *this; }
  112. public: // STATIC METHODS
  113. /**
  114. * Creates an instance of this class and returns a daeElementRef referencing it.
  115. * @return a daeElementRef referencing an instance of this object.
  116. */
  117. static DLLSPEC daeElementRef create(DAE& dae);
  118. /**
  119. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  120. * If a daeMetaElement already exists it will return that instead of creating a new one.
  121. * @return A daeMetaElement describing this COLLADA element.
  122. */
  123. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  124. };
  125. class domShader;
  126. typedef daeSmartRef<domShader> domShaderRef;
  127. typedef daeTArray<domShaderRef> domShader_Array;
  128. /**
  129. * Declare and prepare a shader for execution in the rendering pipeline of
  130. * a pass.
  131. */
  132. class domShader : public daeElement
  133. {
  134. public:
  135. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SHADER; }
  136. static daeInt ID() { return 750; }
  137. virtual daeInt typeID() const { return ID(); }
  138. public:
  139. class domCompiler_target;
  140. typedef daeSmartRef<domCompiler_target> domCompiler_targetRef;
  141. typedef daeTArray<domCompiler_targetRef> domCompiler_target_Array;
  142. class domCompiler_target : public daeElement
  143. {
  144. public:
  145. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::COMPILER_TARGET; }
  146. static daeInt ID() { return 751; }
  147. virtual daeInt typeID() const { return ID(); }
  148. protected: // Value
  149. /**
  150. * The xsNMTOKEN value of the text data of this element.
  151. */
  152. xsNMTOKEN _value;
  153. public: //Accessors and Mutators
  154. /**
  155. * Gets the value of this element.
  156. * @return Returns a xsNMTOKEN of the value.
  157. */
  158. xsNMTOKEN getValue() const { return _value; }
  159. /**
  160. * Sets the _value of this element.
  161. * @param val The new value for this element.
  162. */
  163. void setValue( xsNMTOKEN val ) { *(daeStringRef*)&_value = val; }
  164. protected:
  165. /**
  166. * Constructor
  167. */
  168. domCompiler_target(DAE& dae) : daeElement(dae), _value() {}
  169. /**
  170. * Destructor
  171. */
  172. virtual ~domCompiler_target() {}
  173. /**
  174. * Overloaded assignment operator
  175. */
  176. virtual domCompiler_target &operator=( const domCompiler_target &cpy ) { (void)cpy; return *this; }
  177. public: // STATIC METHODS
  178. /**
  179. * Creates an instance of this class and returns a daeElementRef referencing it.
  180. * @return a daeElementRef referencing an instance of this object.
  181. */
  182. static DLLSPEC daeElementRef create(DAE& dae);
  183. /**
  184. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  185. * If a daeMetaElement already exists it will return that instead of creating a new one.
  186. * @return A daeMetaElement describing this COLLADA element.
  187. */
  188. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  189. };
  190. class domCompiler_options;
  191. typedef daeSmartRef<domCompiler_options> domCompiler_optionsRef;
  192. typedef daeTArray<domCompiler_optionsRef> domCompiler_options_Array;
  193. /**
  194. * A string containing command-line operations for the shader compiler.
  195. */
  196. class domCompiler_options : public daeElement
  197. {
  198. public:
  199. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::COMPILER_OPTIONS; }
  200. static daeInt ID() { return 752; }
  201. virtual daeInt typeID() const { return ID(); }
  202. protected: // Value
  203. /**
  204. * The xsString value of the text data of this element.
  205. */
  206. xsString _value;
  207. public: //Accessors and Mutators
  208. /**
  209. * Gets the value of this element.
  210. * @return Returns a xsString of the value.
  211. */
  212. xsString getValue() const { return _value; }
  213. /**
  214. * Sets the _value of this element.
  215. * @param val The new value for this element.
  216. */
  217. void setValue( xsString val ) { *(daeStringRef*)&_value = val; }
  218. protected:
  219. /**
  220. * Constructor
  221. */
  222. domCompiler_options(DAE& dae) : daeElement(dae), _value() {}
  223. /**
  224. * Destructor
  225. */
  226. virtual ~domCompiler_options() {}
  227. /**
  228. * Overloaded assignment operator
  229. */
  230. virtual domCompiler_options &operator=( const domCompiler_options &cpy ) { (void)cpy; return *this; }
  231. public: // STATIC METHODS
  232. /**
  233. * Creates an instance of this class and returns a daeElementRef referencing it.
  234. * @return a daeElementRef referencing an instance of this object.
  235. */
  236. static DLLSPEC daeElementRef create(DAE& dae);
  237. /**
  238. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  239. * If a daeMetaElement already exists it will return that instead of creating a new one.
  240. * @return A daeMetaElement describing this COLLADA element.
  241. */
  242. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  243. };
  244. class domName;
  245. typedef daeSmartRef<domName> domNameRef;
  246. typedef daeTArray<domNameRef> domName_Array;
  247. /**
  248. * The entry symbol for the shader function.
  249. */
  250. class domName : public daeElement
  251. {
  252. public:
  253. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::NAME; }
  254. static daeInt ID() { return 753; }
  255. virtual daeInt typeID() const { return ID(); }
  256. protected: // Attribute
  257. xsNCName attrSource;
  258. protected: // Value
  259. /**
  260. * The xsNCName value of the text data of this element.
  261. */
  262. xsNCName _value;
  263. public: //Accessors and Mutators
  264. /**
  265. * Gets the source attribute.
  266. * @return Returns a xsNCName of the source attribute.
  267. */
  268. xsNCName getSource() const { return attrSource; }
  269. /**
  270. * Sets the source attribute.
  271. * @param atSource The new value for the source attribute.
  272. */
  273. void setSource( xsNCName atSource ) { *(daeStringRef*)&attrSource = atSource; _validAttributeArray[0] = true; }
  274. /**
  275. * Gets the value of this element.
  276. * @return Returns a xsNCName of the value.
  277. */
  278. xsNCName getValue() const { return _value; }
  279. /**
  280. * Sets the _value of this element.
  281. * @param val The new value for this element.
  282. */
  283. void setValue( xsNCName val ) { *(daeStringRef*)&_value = val; }
  284. protected:
  285. /**
  286. * Constructor
  287. */
  288. domName(DAE& dae) : daeElement(dae), attrSource(), _value() {}
  289. /**
  290. * Destructor
  291. */
  292. virtual ~domName() {}
  293. /**
  294. * Overloaded assignment operator
  295. */
  296. virtual domName &operator=( const domName &cpy ) { (void)cpy; return *this; }
  297. public: // STATIC METHODS
  298. /**
  299. * Creates an instance of this class and returns a daeElementRef referencing it.
  300. * @return a daeElementRef referencing an instance of this object.
  301. */
  302. static DLLSPEC daeElementRef create(DAE& dae);
  303. /**
  304. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  305. * If a daeMetaElement already exists it will return that instead of creating a new one.
  306. * @return A daeMetaElement describing this COLLADA element.
  307. */
  308. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  309. };
  310. class domBind;
  311. typedef daeSmartRef<domBind> domBindRef;
  312. typedef daeTArray<domBindRef> domBind_Array;
  313. /**
  314. * Binds values to uniform inputs of a shader.
  315. */
  316. class domBind : public daeElement
  317. {
  318. public:
  319. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND; }
  320. static daeInt ID() { return 754; }
  321. virtual daeInt typeID() const { return ID(); }
  322. public:
  323. class domParam;
  324. typedef daeSmartRef<domParam> domParamRef;
  325. typedef daeTArray<domParamRef> domParam_Array;
  326. /**
  327. * References a predefined parameter in shader binding declarations.
  328. */
  329. class domParam : public daeElement
  330. {
  331. public:
  332. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PARAM; }
  333. static daeInt ID() { return 755; }
  334. virtual daeInt typeID() const { return ID(); }
  335. protected: // Attribute
  336. xsNCName attrRef;
  337. public: //Accessors and Mutators
  338. /**
  339. * Gets the ref attribute.
  340. * @return Returns a xsNCName of the ref attribute.
  341. */
  342. xsNCName getRef() const { return attrRef; }
  343. /**
  344. * Sets the ref attribute.
  345. * @param atRef The new value for the ref attribute.
  346. */
  347. void setRef( xsNCName atRef ) { *(daeStringRef*)&attrRef = atRef; _validAttributeArray[0] = true; }
  348. protected:
  349. /**
  350. * Constructor
  351. */
  352. domParam(DAE& dae) : daeElement(dae), attrRef() {}
  353. /**
  354. * Destructor
  355. */
  356. virtual ~domParam() {}
  357. /**
  358. * Overloaded assignment operator
  359. */
  360. virtual domParam &operator=( const domParam &cpy ) { (void)cpy; return *this; }
  361. public: // STATIC METHODS
  362. /**
  363. * Creates an instance of this class and returns a daeElementRef referencing it.
  364. * @return a daeElementRef referencing an instance of this object.
  365. */
  366. static DLLSPEC daeElementRef create(DAE& dae);
  367. /**
  368. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  369. * If a daeMetaElement already exists it will return that instead of creating a new one.
  370. * @return A daeMetaElement describing this COLLADA element.
  371. */
  372. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  373. };
  374. protected: // Attribute
  375. /**
  376. * The identifier for a uniform input parameter to the shader (a formal function
  377. * parameter or in-scope global) that will be bound to an external resource.
  378. */
  379. xsNCName attrSymbol;
  380. protected: // Elements
  381. domCg_param_typeRef elemCg_param_type;
  382. /**
  383. * References a predefined parameter in shader binding declarations. @see
  384. * domParam
  385. */
  386. domParamRef elemParam;
  387. /**
  388. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  389. */
  390. daeElementRefArray _contents;
  391. /**
  392. * Used to preserve order in elements that have a complex content model.
  393. */
  394. daeUIntArray _contentsOrder;
  395. /**
  396. * Used to store information needed for some content model objects.
  397. */
  398. daeTArray< daeCharArray * > _CMData;
  399. public: //Accessors and Mutators
  400. /**
  401. * Gets the symbol attribute.
  402. * @return Returns a xsNCName of the symbol attribute.
  403. */
  404. xsNCName getSymbol() const { return attrSymbol; }
  405. /**
  406. * Sets the symbol attribute.
  407. * @param atSymbol The new value for the symbol attribute.
  408. */
  409. void setSymbol( xsNCName atSymbol ) { *(daeStringRef*)&attrSymbol = atSymbol; _validAttributeArray[0] = true; }
  410. /**
  411. * Gets the cg_param_type element.
  412. * @return a daeSmartRef to the cg_param_type element.
  413. */
  414. const domCg_param_typeRef getCg_param_type() const { return elemCg_param_type; }
  415. /**
  416. * Gets the param element.
  417. * @return a daeSmartRef to the param element.
  418. */
  419. const domParamRef getParam() const { return elemParam; }
  420. /**
  421. * Gets the _contents array.
  422. * @return Returns a reference to the _contents element array.
  423. */
  424. daeElementRefArray &getContents() { return _contents; }
  425. /**
  426. * Gets the _contents array.
  427. * @return Returns a constant reference to the _contents element array.
  428. */
  429. const daeElementRefArray &getContents() const { return _contents; }
  430. protected:
  431. /**
  432. * Constructor
  433. */
  434. domBind(DAE& dae) : daeElement(dae), attrSymbol(), elemCg_param_type(), elemParam() {}
  435. /**
  436. * Destructor
  437. */
  438. virtual ~domBind() { daeElement::deleteCMDataArray(_CMData); }
  439. /**
  440. * Overloaded assignment operator
  441. */
  442. virtual domBind &operator=( const domBind &cpy ) { (void)cpy; return *this; }
  443. public: // STATIC METHODS
  444. /**
  445. * Creates an instance of this class and returns a daeElementRef referencing it.
  446. * @return a daeElementRef referencing an instance of this object.
  447. */
  448. static DLLSPEC daeElementRef create(DAE& dae);
  449. /**
  450. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  451. * If a daeMetaElement already exists it will return that instead of creating a new one.
  452. * @return A daeMetaElement describing this COLLADA element.
  453. */
  454. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  455. };
  456. protected: // Attribute
  457. /**
  458. * In which pipeline stage this programmable shader is designed to execute,
  459. * for example, VERTEX, FRAGMENT, etc.
  460. */
  461. domCg_pipeline_stage attrStage;
  462. protected: // Elements
  463. domFx_annotate_common_Array elemAnnotate_array;
  464. domCompiler_targetRef elemCompiler_target;
  465. /**
  466. * A string containing command-line operations for the shader compiler. @see
  467. * domCompiler_options
  468. */
  469. domCompiler_optionsRef elemCompiler_options;
  470. /**
  471. * The entry symbol for the shader function. @see domName
  472. */
  473. domNameRef elemName;
  474. /**
  475. * Binds values to uniform inputs of a shader. @see domBind
  476. */
  477. domBind_Array elemBind_array;
  478. public: //Accessors and Mutators
  479. /**
  480. * Gets the stage attribute.
  481. * @return Returns a domCg_pipeline_stage of the stage attribute.
  482. */
  483. domCg_pipeline_stage getStage() const { return attrStage; }
  484. /**
  485. * Sets the stage attribute.
  486. * @param atStage The new value for the stage attribute.
  487. */
  488. void setStage( domCg_pipeline_stage atStage ) { attrStage = atStage; _validAttributeArray[0] = true; }
  489. /**
  490. * Gets the annotate element array.
  491. * @return Returns a reference to the array of annotate elements.
  492. */
  493. domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; }
  494. /**
  495. * Gets the annotate element array.
  496. * @return Returns a constant reference to the array of annotate elements.
  497. */
  498. const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; }
  499. /**
  500. * Gets the compiler_target element.
  501. * @return a daeSmartRef to the compiler_target element.
  502. */
  503. const domCompiler_targetRef getCompiler_target() const { return elemCompiler_target; }
  504. /**
  505. * Gets the compiler_options element.
  506. * @return a daeSmartRef to the compiler_options element.
  507. */
  508. const domCompiler_optionsRef getCompiler_options() const { return elemCompiler_options; }
  509. /**
  510. * Gets the name element.
  511. * @return a daeSmartRef to the name element.
  512. */
  513. const domNameRef getName() const { return elemName; }
  514. /**
  515. * Gets the bind element array.
  516. * @return Returns a reference to the array of bind elements.
  517. */
  518. domBind_Array &getBind_array() { return elemBind_array; }
  519. /**
  520. * Gets the bind element array.
  521. * @return Returns a constant reference to the array of bind elements.
  522. */
  523. const domBind_Array &getBind_array() const { return elemBind_array; }
  524. protected:
  525. /**
  526. * Constructor
  527. */
  528. domShader(DAE& dae) : daeElement(dae), attrStage(), elemAnnotate_array(), elemCompiler_target(), elemCompiler_options(), elemName(), elemBind_array() {}
  529. /**
  530. * Destructor
  531. */
  532. virtual ~domShader() {}
  533. /**
  534. * Overloaded assignment operator
  535. */
  536. virtual domShader &operator=( const domShader &cpy ) { (void)cpy; return *this; }
  537. public: // STATIC METHODS
  538. /**
  539. * Creates an instance of this class and returns a daeElementRef referencing it.
  540. * @return a daeElementRef referencing an instance of this object.
  541. */
  542. static DLLSPEC daeElementRef create(DAE& dae);
  543. /**
  544. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  545. * If a daeMetaElement already exists it will return that instead of creating a new one.
  546. * @return A daeMetaElement describing this COLLADA element.
  547. */
  548. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  549. };
  550. protected: // Attribute
  551. /**
  552. * The sid attribute is a text string value containing the sub-identifier
  553. * of this element. This value must be unique within the scope of the parent
  554. * element. Optional attribute.
  555. */
  556. xsNCName attrSid;
  557. protected: // Elements
  558. domFx_annotate_common_Array elemAnnotate_array;
  559. domFx_colortarget_common_Array elemColor_target_array;
  560. domFx_depthtarget_common_Array elemDepth_target_array;
  561. domFx_stenciltarget_common_Array elemStencil_target_array;
  562. domFx_clearcolor_common_Array elemColor_clear_array;
  563. domFx_cleardepth_common_Array elemDepth_clear_array;
  564. domFx_clearstencil_common_Array elemStencil_clear_array;
  565. domDrawRef elemDraw;
  566. domGl_pipeline_settings_Array elemGl_pipeline_settings_array;
  567. /**
  568. * Declare and prepare a shader for execution in the rendering pipeline of
  569. * a pass. @see domShader
  570. */
  571. domShader_Array elemShader_array;
  572. domExtra_Array elemExtra_array;
  573. /**
  574. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  575. */
  576. daeElementRefArray _contents;
  577. /**
  578. * Used to preserve order in elements that have a complex content model.
  579. */
  580. daeUIntArray _contentsOrder;
  581. /**
  582. * Used to store information needed for some content model objects.
  583. */
  584. daeTArray< daeCharArray * > _CMData;
  585. public: //Accessors and Mutators
  586. /**
  587. * Gets the sid attribute.
  588. * @return Returns a xsNCName of the sid attribute.
  589. */
  590. xsNCName getSid() const { return attrSid; }
  591. /**
  592. * Sets the sid attribute.
  593. * @param atSid The new value for the sid attribute.
  594. */
  595. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
  596. /**
  597. * Gets the annotate element array.
  598. * @return Returns a reference to the array of annotate elements.
  599. */
  600. domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; }
  601. /**
  602. * Gets the annotate element array.
  603. * @return Returns a constant reference to the array of annotate elements.
  604. */
  605. const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; }
  606. /**
  607. * Gets the color_target element array.
  608. * @return Returns a reference to the array of color_target elements.
  609. */
  610. domFx_colortarget_common_Array &getColor_target_array() { return elemColor_target_array; }
  611. /**
  612. * Gets the color_target element array.
  613. * @return Returns a constant reference to the array of color_target elements.
  614. */
  615. const domFx_colortarget_common_Array &getColor_target_array() const { return elemColor_target_array; }
  616. /**
  617. * Gets the depth_target element array.
  618. * @return Returns a reference to the array of depth_target elements.
  619. */
  620. domFx_depthtarget_common_Array &getDepth_target_array() { return elemDepth_target_array; }
  621. /**
  622. * Gets the depth_target element array.
  623. * @return Returns a constant reference to the array of depth_target elements.
  624. */
  625. const domFx_depthtarget_common_Array &getDepth_target_array() const { return elemDepth_target_array; }
  626. /**
  627. * Gets the stencil_target element array.
  628. * @return Returns a reference to the array of stencil_target elements.
  629. */
  630. domFx_stenciltarget_common_Array &getStencil_target_array() { return elemStencil_target_array; }
  631. /**
  632. * Gets the stencil_target element array.
  633. * @return Returns a constant reference to the array of stencil_target elements.
  634. */
  635. const domFx_stenciltarget_common_Array &getStencil_target_array() const { return elemStencil_target_array; }
  636. /**
  637. * Gets the color_clear element array.
  638. * @return Returns a reference to the array of color_clear elements.
  639. */
  640. domFx_clearcolor_common_Array &getColor_clear_array() { return elemColor_clear_array; }
  641. /**
  642. * Gets the color_clear element array.
  643. * @return Returns a constant reference to the array of color_clear elements.
  644. */
  645. const domFx_clearcolor_common_Array &getColor_clear_array() const { return elemColor_clear_array; }
  646. /**
  647. * Gets the depth_clear element array.
  648. * @return Returns a reference to the array of depth_clear elements.
  649. */
  650. domFx_cleardepth_common_Array &getDepth_clear_array() { return elemDepth_clear_array; }
  651. /**
  652. * Gets the depth_clear element array.
  653. * @return Returns a constant reference to the array of depth_clear elements.
  654. */
  655. const domFx_cleardepth_common_Array &getDepth_clear_array() const { return elemDepth_clear_array; }
  656. /**
  657. * Gets the stencil_clear element array.
  658. * @return Returns a reference to the array of stencil_clear elements.
  659. */
  660. domFx_clearstencil_common_Array &getStencil_clear_array() { return elemStencil_clear_array; }
  661. /**
  662. * Gets the stencil_clear element array.
  663. * @return Returns a constant reference to the array of stencil_clear elements.
  664. */
  665. const domFx_clearstencil_common_Array &getStencil_clear_array() const { return elemStencil_clear_array; }
  666. /**
  667. * Gets the draw element.
  668. * @return a daeSmartRef to the draw element.
  669. */
  670. const domDrawRef getDraw() const { return elemDraw; }
  671. /**
  672. * Gets the gl_pipeline_settings element array.
  673. * @return Returns a reference to the array of gl_pipeline_settings elements.
  674. */
  675. domGl_pipeline_settings_Array &getGl_pipeline_settings_array() { return elemGl_pipeline_settings_array; }
  676. /**
  677. * Gets the gl_pipeline_settings element array.
  678. * @return Returns a constant reference to the array of gl_pipeline_settings elements.
  679. */
  680. const domGl_pipeline_settings_Array &getGl_pipeline_settings_array() const { return elemGl_pipeline_settings_array; }
  681. /**
  682. * Gets the shader element array.
  683. * @return Returns a reference to the array of shader elements.
  684. */
  685. domShader_Array &getShader_array() { return elemShader_array; }
  686. /**
  687. * Gets the shader element array.
  688. * @return Returns a constant reference to the array of shader elements.
  689. */
  690. const domShader_Array &getShader_array() const { return elemShader_array; }
  691. /**
  692. * Gets the extra element array.
  693. * @return Returns a reference to the array of extra elements.
  694. */
  695. domExtra_Array &getExtra_array() { return elemExtra_array; }
  696. /**
  697. * Gets the extra element array.
  698. * @return Returns a constant reference to the array of extra elements.
  699. */
  700. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  701. /**
  702. * Gets the _contents array.
  703. * @return Returns a reference to the _contents element array.
  704. */
  705. daeElementRefArray &getContents() { return _contents; }
  706. /**
  707. * Gets the _contents array.
  708. * @return Returns a constant reference to the _contents element array.
  709. */
  710. const daeElementRefArray &getContents() const { return _contents; }
  711. protected:
  712. /**
  713. * Constructor
  714. */
  715. domPass(DAE& dae) : daeElement(dae), attrSid(), elemAnnotate_array(), elemColor_target_array(), elemDepth_target_array(), elemStencil_target_array(), elemColor_clear_array(), elemDepth_clear_array(), elemStencil_clear_array(), elemDraw(), elemGl_pipeline_settings_array(), elemShader_array(), elemExtra_array() {}
  716. /**
  717. * Destructor
  718. */
  719. virtual ~domPass() { daeElement::deleteCMDataArray(_CMData); }
  720. /**
  721. * Overloaded assignment operator
  722. */
  723. virtual domPass &operator=( const domPass &cpy ) { (void)cpy; return *this; }
  724. public: // STATIC METHODS
  725. /**
  726. * Creates an instance of this class and returns a daeElementRef referencing it.
  727. * @return a daeElementRef referencing an instance of this object.
  728. */
  729. static DLLSPEC daeElementRef create(DAE& dae);
  730. /**
  731. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  732. * If a daeMetaElement already exists it will return that instead of creating a new one.
  733. * @return A daeMetaElement describing this COLLADA element.
  734. */
  735. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  736. };
  737. protected: // Attributes
  738. /**
  739. * The id attribute is a text string containing the unique identifier of
  740. * this element. This value must be unique within the instance document.
  741. * Optional attribute.
  742. */
  743. xsID attrId;
  744. /**
  745. * The sid attribute is a text string value containing the sub-identifier
  746. * of this element. This value must be unique within the scope of the parent
  747. * element. Optional attribute.
  748. */
  749. xsNCName attrSid;
  750. protected: // Elements
  751. /**
  752. * The technique element may contain an asset element. @see domAsset
  753. */
  754. domAssetRef elemAsset;
  755. domFx_annotate_common_Array elemAnnotate_array;
  756. domFx_code_profile_Array elemCode_array;
  757. domFx_include_common_Array elemInclude_array;
  758. domImage_Array elemImage_array;
  759. domCg_newparam_Array elemNewparam_array;
  760. domCg_setparam_Array elemSetparam_array;
  761. /**
  762. * A static declaration of all the render states, shaders, and settings for
  763. * one rendering pipeline. @see domPass
  764. */
  765. domPass_Array elemPass_array;
  766. domExtra_Array elemExtra_array;
  767. /**
  768. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  769. */
  770. daeElementRefArray _contents;
  771. /**
  772. * Used to preserve order in elements that have a complex content model.
  773. */
  774. daeUIntArray _contentsOrder;
  775. /**
  776. * Used to store information needed for some content model objects.
  777. */
  778. daeTArray< daeCharArray * > _CMData;
  779. public: //Accessors and Mutators
  780. /**
  781. * Gets the id attribute.
  782. * @return Returns a xsID of the id attribute.
  783. */
  784. xsID getId() const { return attrId; }
  785. /**
  786. * Sets the id attribute.
  787. * @param atId The new value for the id attribute.
  788. */
  789. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  790. if( _document != NULL ) _document->changeElementID( this, attrId );
  791. }
  792. /**
  793. * Gets the sid attribute.
  794. * @return Returns a xsNCName of the sid attribute.
  795. */
  796. xsNCName getSid() const { return attrSid; }
  797. /**
  798. * Sets the sid attribute.
  799. * @param atSid The new value for the sid attribute.
  800. */
  801. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; }
  802. /**
  803. * Gets the asset element.
  804. * @return a daeSmartRef to the asset element.
  805. */
  806. const domAssetRef getAsset() const { return elemAsset; }
  807. /**
  808. * Gets the annotate element array.
  809. * @return Returns a reference to the array of annotate elements.
  810. */
  811. domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; }
  812. /**
  813. * Gets the annotate element array.
  814. * @return Returns a constant reference to the array of annotate elements.
  815. */
  816. const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; }
  817. /**
  818. * Gets the code element array.
  819. * @return Returns a reference to the array of code elements.
  820. */
  821. domFx_code_profile_Array &getCode_array() { return elemCode_array; }
  822. /**
  823. * Gets the code element array.
  824. * @return Returns a constant reference to the array of code elements.
  825. */
  826. const domFx_code_profile_Array &getCode_array() const { return elemCode_array; }
  827. /**
  828. * Gets the include element array.
  829. * @return Returns a reference to the array of include elements.
  830. */
  831. domFx_include_common_Array &getInclude_array() { return elemInclude_array; }
  832. /**
  833. * Gets the include element array.
  834. * @return Returns a constant reference to the array of include elements.
  835. */
  836. const domFx_include_common_Array &getInclude_array() const { return elemInclude_array; }
  837. /**
  838. * Gets the image element array.
  839. * @return Returns a reference to the array of image elements.
  840. */
  841. domImage_Array &getImage_array() { return elemImage_array; }
  842. /**
  843. * Gets the image element array.
  844. * @return Returns a constant reference to the array of image elements.
  845. */
  846. const domImage_Array &getImage_array() const { return elemImage_array; }
  847. /**
  848. * Gets the newparam element array.
  849. * @return Returns a reference to the array of newparam elements.
  850. */
  851. domCg_newparam_Array &getNewparam_array() { return elemNewparam_array; }
  852. /**
  853. * Gets the newparam element array.
  854. * @return Returns a constant reference to the array of newparam elements.
  855. */
  856. const domCg_newparam_Array &getNewparam_array() const { return elemNewparam_array; }
  857. /**
  858. * Gets the setparam element array.
  859. * @return Returns a reference to the array of setparam elements.
  860. */
  861. domCg_setparam_Array &getSetparam_array() { return elemSetparam_array; }
  862. /**
  863. * Gets the setparam element array.
  864. * @return Returns a constant reference to the array of setparam elements.
  865. */
  866. const domCg_setparam_Array &getSetparam_array() const { return elemSetparam_array; }
  867. /**
  868. * Gets the pass element array.
  869. * @return Returns a reference to the array of pass elements.
  870. */
  871. domPass_Array &getPass_array() { return elemPass_array; }
  872. /**
  873. * Gets the pass element array.
  874. * @return Returns a constant reference to the array of pass elements.
  875. */
  876. const domPass_Array &getPass_array() const { return elemPass_array; }
  877. /**
  878. * Gets the extra element array.
  879. * @return Returns a reference to the array of extra elements.
  880. */
  881. domExtra_Array &getExtra_array() { return elemExtra_array; }
  882. /**
  883. * Gets the extra element array.
  884. * @return Returns a constant reference to the array of extra elements.
  885. */
  886. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  887. /**
  888. * Gets the _contents array.
  889. * @return Returns a reference to the _contents element array.
  890. */
  891. daeElementRefArray &getContents() { return _contents; }
  892. /**
  893. * Gets the _contents array.
  894. * @return Returns a constant reference to the _contents element array.
  895. */
  896. const daeElementRefArray &getContents() const { return _contents; }
  897. protected:
  898. /**
  899. * Constructor
  900. */
  901. domTechnique(DAE& dae) : daeElement(dae), attrId(), attrSid(), elemAsset(), elemAnnotate_array(), elemCode_array(), elemInclude_array(), elemImage_array(), elemNewparam_array(), elemSetparam_array(), elemPass_array(), elemExtra_array() {}
  902. /**
  903. * Destructor
  904. */
  905. virtual ~domTechnique() { daeElement::deleteCMDataArray(_CMData); }
  906. /**
  907. * Overloaded assignment operator
  908. */
  909. virtual domTechnique &operator=( const domTechnique &cpy ) { (void)cpy; return *this; }
  910. public: // STATIC METHODS
  911. /**
  912. * Creates an instance of this class and returns a daeElementRef referencing it.
  913. * @return a daeElementRef referencing an instance of this object.
  914. */
  915. static DLLSPEC daeElementRef create(DAE& dae);
  916. /**
  917. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  918. * If a daeMetaElement already exists it will return that instead of creating a new one.
  919. * @return A daeMetaElement describing this COLLADA element.
  920. */
  921. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  922. };
  923. protected: // Attributes
  924. /**
  925. * The id attribute is a text string containing the unique identifier of
  926. * this element. This value must be unique within the instance document.
  927. * Optional attribute.
  928. */
  929. xsID attrId;
  930. /**
  931. * The type of platform. This is a vendor-defined character string that indicates
  932. * the platform or capability target for the technique. Optional
  933. */
  934. xsNCName attrPlatform;
  935. protected: // Elements
  936. domAssetRef elemAsset;
  937. domFx_code_profile_Array elemCode_array;
  938. domFx_include_common_Array elemInclude_array;
  939. domImage_Array elemImage_array;
  940. domCg_newparam_Array elemNewparam_array;
  941. /**
  942. * Holds a description of the textures, samplers, shaders, parameters, and
  943. * passes necessary for rendering this effect using one method. @see domTechnique
  944. */
  945. domTechnique_Array elemTechnique_array;
  946. domExtra_Array elemExtra_array;
  947. /**
  948. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  949. */
  950. daeElementRefArray _contents;
  951. /**
  952. * Used to preserve order in elements that have a complex content model.
  953. */
  954. daeUIntArray _contentsOrder;
  955. /**
  956. * Used to store information needed for some content model objects.
  957. */
  958. daeTArray< daeCharArray * > _CMData;
  959. public: //Accessors and Mutators
  960. /**
  961. * Gets the id attribute.
  962. * @return Returns a xsID of the id attribute.
  963. */
  964. xsID getId() const { return attrId; }
  965. /**
  966. * Sets the id attribute.
  967. * @param atId The new value for the id attribute.
  968. */
  969. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  970. if( _document != NULL ) _document->changeElementID( this, attrId );
  971. }
  972. /**
  973. * Gets the platform attribute.
  974. * @return Returns a xsNCName of the platform attribute.
  975. */
  976. xsNCName getPlatform() const { return attrPlatform; }
  977. /**
  978. * Sets the platform attribute.
  979. * @param atPlatform The new value for the platform attribute.
  980. */
  981. void setPlatform( xsNCName atPlatform ) { *(daeStringRef*)&attrPlatform = atPlatform; _validAttributeArray[1] = true; }
  982. /**
  983. * Gets the asset element.
  984. * @return a daeSmartRef to the asset element.
  985. */
  986. const domAssetRef getAsset() const { return elemAsset; }
  987. /**
  988. * Gets the code element array.
  989. * @return Returns a reference to the array of code elements.
  990. */
  991. domFx_code_profile_Array &getCode_array() { return elemCode_array; }
  992. /**
  993. * Gets the code element array.
  994. * @return Returns a constant reference to the array of code elements.
  995. */
  996. const domFx_code_profile_Array &getCode_array() const { return elemCode_array; }
  997. /**
  998. * Gets the include element array.
  999. * @return Returns a reference to the array of include elements.
  1000. */
  1001. domFx_include_common_Array &getInclude_array() { return elemInclude_array; }
  1002. /**
  1003. * Gets the include element array.
  1004. * @return Returns a constant reference to the array of include elements.
  1005. */
  1006. const domFx_include_common_Array &getInclude_array() const { return elemInclude_array; }
  1007. /**
  1008. * Gets the image element array.
  1009. * @return Returns a reference to the array of image elements.
  1010. */
  1011. domImage_Array &getImage_array() { return elemImage_array; }
  1012. /**
  1013. * Gets the image element array.
  1014. * @return Returns a constant reference to the array of image elements.
  1015. */
  1016. const domImage_Array &getImage_array() const { return elemImage_array; }
  1017. /**
  1018. * Gets the newparam element array.
  1019. * @return Returns a reference to the array of newparam elements.
  1020. */
  1021. domCg_newparam_Array &getNewparam_array() { return elemNewparam_array; }
  1022. /**
  1023. * Gets the newparam element array.
  1024. * @return Returns a constant reference to the array of newparam elements.
  1025. */
  1026. const domCg_newparam_Array &getNewparam_array() const { return elemNewparam_array; }
  1027. /**
  1028. * Gets the technique element array.
  1029. * @return Returns a reference to the array of technique elements.
  1030. */
  1031. domTechnique_Array &getTechnique_array() { return elemTechnique_array; }
  1032. /**
  1033. * Gets the technique element array.
  1034. * @return Returns a constant reference to the array of technique elements.
  1035. */
  1036. const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; }
  1037. /**
  1038. * Gets the extra element array.
  1039. * @return Returns a reference to the array of extra elements.
  1040. */
  1041. domExtra_Array &getExtra_array() { return elemExtra_array; }
  1042. /**
  1043. * Gets the extra element array.
  1044. * @return Returns a constant reference to the array of extra elements.
  1045. */
  1046. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  1047. /**
  1048. * Gets the _contents array.
  1049. * @return Returns a reference to the _contents element array.
  1050. */
  1051. daeElementRefArray &getContents() { return _contents; }
  1052. /**
  1053. * Gets the _contents array.
  1054. * @return Returns a constant reference to the _contents element array.
  1055. */
  1056. const daeElementRefArray &getContents() const { return _contents; }
  1057. protected:
  1058. /**
  1059. * Constructor
  1060. */
  1061. domProfile_CG(DAE& dae) : domFx_profile_abstract(dae), attrId(), attrPlatform(), elemAsset(), elemCode_array(), elemInclude_array(), elemImage_array(), elemNewparam_array(), elemTechnique_array(), elemExtra_array() {}
  1062. /**
  1063. * Destructor
  1064. */
  1065. virtual ~domProfile_CG() { daeElement::deleteCMDataArray(_CMData); }
  1066. /**
  1067. * Overloaded assignment operator
  1068. */
  1069. virtual domProfile_CG &operator=( const domProfile_CG &cpy ) { (void)cpy; return *this; }
  1070. public: // STATIC METHODS
  1071. /**
  1072. * Creates an instance of this class and returns a daeElementRef referencing it.
  1073. * @return a daeElementRef referencing an instance of this object.
  1074. */
  1075. static DLLSPEC daeElementRef create(DAE& dae);
  1076. /**
  1077. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  1078. * If a daeMetaElement already exists it will return that instead of creating a new one.
  1079. * @return A daeMetaElement describing this COLLADA element.
  1080. */
  1081. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  1082. };
  1083. #endif