domProfile_GLSL.h 39 KB

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