domVisual_scene.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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 __domVisual_scene_h__
  14. #define __domVisual_scene_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domAsset.h>
  19. #include <dom/domNode.h>
  20. #include <dom/domExtra.h>
  21. #include <dom/domInstance_effect.h>
  22. class DAE;
  23. /**
  24. * The visual_scene element declares the base of the visual_scene hierarchy
  25. * or scene graph. The scene contains elements that comprise much of the
  26. * visual and transformational information content as created by the authoring
  27. * tools.
  28. */
  29. class domVisual_scene : public daeElement
  30. {
  31. public:
  32. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::VISUAL_SCENE; }
  33. static daeInt ID() { return 682; }
  34. virtual daeInt typeID() const { return ID(); }
  35. public:
  36. class domEvaluate_scene;
  37. typedef daeSmartRef<domEvaluate_scene> domEvaluate_sceneRef;
  38. typedef daeTArray<domEvaluate_sceneRef> domEvaluate_scene_Array;
  39. /**
  40. * The evaluate_scene element declares information specifying a specific way
  41. * to evaluate this visual_scene. There may be any number of evaluate_scene
  42. * elements.
  43. */
  44. class domEvaluate_scene : public daeElement
  45. {
  46. public:
  47. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::EVALUATE_SCENE; }
  48. static daeInt ID() { return 683; }
  49. virtual daeInt typeID() const { return ID(); }
  50. public:
  51. class domRender;
  52. typedef daeSmartRef<domRender> domRenderRef;
  53. typedef daeTArray<domRenderRef> domRender_Array;
  54. /**
  55. * The render element describes one effect pass to evaluate the scene. There
  56. * must be at least one render element.
  57. */
  58. class domRender : public daeElement
  59. {
  60. public:
  61. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::RENDER; }
  62. static daeInt ID() { return 684; }
  63. virtual daeInt typeID() const { return ID(); }
  64. public:
  65. class domLayer;
  66. typedef daeSmartRef<domLayer> domLayerRef;
  67. typedef daeTArray<domLayerRef> domLayer_Array;
  68. /**
  69. * The layer element specifies which layer to render in this compositing step
  70. * while evaluating the scene. You may specify any number of layers.
  71. */
  72. class domLayer : public daeElement
  73. {
  74. public:
  75. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::LAYER; }
  76. static daeInt ID() { return 685; }
  77. virtual daeInt typeID() const { return ID(); }
  78. protected: // Value
  79. /**
  80. * The xsNCName value of the text data of this element.
  81. */
  82. xsNCName _value;
  83. public: //Accessors and Mutators
  84. /**
  85. * Gets the value of this element.
  86. * @return Returns a xsNCName of the value.
  87. */
  88. xsNCName getValue() const { return _value; }
  89. /**
  90. * Sets the _value of this element.
  91. * @param val The new value for this element.
  92. */
  93. void setValue( xsNCName val ) { *(daeStringRef*)&_value = val; }
  94. protected:
  95. /**
  96. * Constructor
  97. */
  98. domLayer(DAE& dae) : daeElement(dae), _value() {}
  99. /**
  100. * Destructor
  101. */
  102. virtual ~domLayer() {}
  103. /**
  104. * Overloaded assignment operator
  105. */
  106. virtual domLayer &operator=( const domLayer &cpy ) { (void)cpy; return *this; }
  107. public: // STATIC METHODS
  108. /**
  109. * Creates an instance of this class and returns a daeElementRef referencing it.
  110. * @return a daeElementRef referencing an instance of this object.
  111. */
  112. static DLLSPEC daeElementRef create(DAE& dae);
  113. /**
  114. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  115. * If a daeMetaElement already exists it will return that instead of creating a new one.
  116. * @return A daeMetaElement describing this COLLADA element.
  117. */
  118. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  119. };
  120. protected: // Attribute
  121. /**
  122. * The camera_node attribute refers to a node that contains a camera describing
  123. * the viewpoint to render this compositing step from.
  124. */
  125. xsAnyURI attrCamera_node;
  126. protected: // Elements
  127. /**
  128. * The layer element specifies which layer to render in this compositing step
  129. * while evaluating the scene. You may specify any number of layers. @see
  130. * domLayer
  131. */
  132. domLayer_Array elemLayer_array;
  133. /**
  134. * The instance_effect element specifies which effect to render in this compositing
  135. * step while evaluating the scene. @see domInstance_effect
  136. */
  137. domInstance_effectRef elemInstance_effect;
  138. public: //Accessors and Mutators
  139. /**
  140. * Gets the camera_node attribute.
  141. * @return Returns a xsAnyURI reference of the camera_node attribute.
  142. */
  143. xsAnyURI &getCamera_node() { return attrCamera_node; }
  144. /**
  145. * Gets the camera_node attribute.
  146. * @return Returns a constant xsAnyURI reference of the camera_node attribute.
  147. */
  148. const xsAnyURI &getCamera_node() const { return attrCamera_node; }
  149. /**
  150. * Sets the camera_node attribute.
  151. * @param atCamera_node The new value for the camera_node attribute.
  152. */
  153. void setCamera_node( const xsAnyURI &atCamera_node ) { attrCamera_node = atCamera_node; _validAttributeArray[0] = true; }
  154. /**
  155. * Sets the camera_node attribute.
  156. * @param atCamera_node The new value for the camera_node attribute.
  157. */
  158. void setCamera_node( xsString atCamera_node ) { attrCamera_node = atCamera_node; _validAttributeArray[0] = true; }
  159. /**
  160. * Gets the layer element array.
  161. * @return Returns a reference to the array of layer elements.
  162. */
  163. domLayer_Array &getLayer_array() { return elemLayer_array; }
  164. /**
  165. * Gets the layer element array.
  166. * @return Returns a constant reference to the array of layer elements.
  167. */
  168. const domLayer_Array &getLayer_array() const { return elemLayer_array; }
  169. /**
  170. * Gets the instance_effect element.
  171. * @return a daeSmartRef to the instance_effect element.
  172. */
  173. const domInstance_effectRef getInstance_effect() const { return elemInstance_effect; }
  174. protected:
  175. /**
  176. * Constructor
  177. */
  178. domRender(DAE& dae) : daeElement(dae), attrCamera_node(dae, *this), elemLayer_array(), elemInstance_effect() {}
  179. /**
  180. * Destructor
  181. */
  182. virtual ~domRender() {}
  183. /**
  184. * Overloaded assignment operator
  185. */
  186. virtual domRender &operator=( const domRender &cpy ) { (void)cpy; return *this; }
  187. public: // STATIC METHODS
  188. /**
  189. * Creates an instance of this class and returns a daeElementRef referencing it.
  190. * @return a daeElementRef referencing an instance of this object.
  191. */
  192. static DLLSPEC daeElementRef create(DAE& dae);
  193. /**
  194. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  195. * If a daeMetaElement already exists it will return that instead of creating a new one.
  196. * @return A daeMetaElement describing this COLLADA element.
  197. */
  198. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  199. };
  200. protected: // Attribute
  201. /**
  202. * The name attribute is the text string name of this element. Optional attribute.
  203. */
  204. xsNCName attrName;
  205. protected: // Element
  206. /**
  207. * The render element describes one effect pass to evaluate the scene. There
  208. * must be at least one render element. @see domRender
  209. */
  210. domRender_Array elemRender_array;
  211. public: //Accessors and Mutators
  212. /**
  213. * Gets the name attribute.
  214. * @return Returns a xsNCName of the name attribute.
  215. */
  216. xsNCName getName() const { return attrName; }
  217. /**
  218. * Sets the name attribute.
  219. * @param atName The new value for the name attribute.
  220. */
  221. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[0] = true; }
  222. /**
  223. * Gets the render element array.
  224. * @return Returns a reference to the array of render elements.
  225. */
  226. domRender_Array &getRender_array() { return elemRender_array; }
  227. /**
  228. * Gets the render element array.
  229. * @return Returns a constant reference to the array of render elements.
  230. */
  231. const domRender_Array &getRender_array() const { return elemRender_array; }
  232. protected:
  233. /**
  234. * Constructor
  235. */
  236. domEvaluate_scene(DAE& dae) : daeElement(dae), attrName(), elemRender_array() {}
  237. /**
  238. * Destructor
  239. */
  240. virtual ~domEvaluate_scene() {}
  241. /**
  242. * Overloaded assignment operator
  243. */
  244. virtual domEvaluate_scene &operator=( const domEvaluate_scene &cpy ) { (void)cpy; return *this; }
  245. public: // STATIC METHODS
  246. /**
  247. * Creates an instance of this class and returns a daeElementRef referencing it.
  248. * @return a daeElementRef referencing an instance of this object.
  249. */
  250. static DLLSPEC daeElementRef create(DAE& dae);
  251. /**
  252. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  253. * If a daeMetaElement already exists it will return that instead of creating a new one.
  254. * @return A daeMetaElement describing this COLLADA element.
  255. */
  256. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  257. };
  258. protected: // Attributes
  259. /**
  260. * The id attribute is a text string containing the unique identifier of
  261. * this element. This value must be unique within the instance document.
  262. * Optional attribute.
  263. */
  264. xsID attrId;
  265. /**
  266. * The name attribute is the text string name of this element. Optional attribute.
  267. */
  268. xsNCName attrName;
  269. protected: // Elements
  270. /**
  271. * The visual_scene element may contain an asset element. @see domAsset
  272. */
  273. domAssetRef elemAsset;
  274. /**
  275. * The visual_scene element must have at least one node element. @see domNode
  276. */
  277. domNode_Array elemNode_array;
  278. /**
  279. * The evaluate_scene element declares information specifying a specific way
  280. * to evaluate this visual_scene. There may be any number of evaluate_scene
  281. * elements. @see domEvaluate_scene
  282. */
  283. domEvaluate_scene_Array elemEvaluate_scene_array;
  284. /**
  285. * The extra element may appear any number of times. @see domExtra
  286. */
  287. domExtra_Array elemExtra_array;
  288. public: //Accessors and Mutators
  289. /**
  290. * Gets the id attribute.
  291. * @return Returns a xsID of the id attribute.
  292. */
  293. xsID getId() const { return attrId; }
  294. /**
  295. * Sets the id attribute.
  296. * @param atId The new value for the id attribute.
  297. */
  298. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  299. if( _document != NULL ) _document->changeElementID( this, attrId );
  300. }
  301. /**
  302. * Gets the name attribute.
  303. * @return Returns a xsNCName of the name attribute.
  304. */
  305. xsNCName getName() const { return attrName; }
  306. /**
  307. * Sets the name attribute.
  308. * @param atName The new value for the name attribute.
  309. */
  310. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  311. /**
  312. * Gets the asset element.
  313. * @return a daeSmartRef to the asset element.
  314. */
  315. const domAssetRef getAsset() const { return elemAsset; }
  316. /**
  317. * Gets the node element array.
  318. * @return Returns a reference to the array of node elements.
  319. */
  320. domNode_Array &getNode_array() { return elemNode_array; }
  321. /**
  322. * Gets the node element array.
  323. * @return Returns a constant reference to the array of node elements.
  324. */
  325. const domNode_Array &getNode_array() const { return elemNode_array; }
  326. /**
  327. * Gets the evaluate_scene element array.
  328. * @return Returns a reference to the array of evaluate_scene elements.
  329. */
  330. domEvaluate_scene_Array &getEvaluate_scene_array() { return elemEvaluate_scene_array; }
  331. /**
  332. * Gets the evaluate_scene element array.
  333. * @return Returns a constant reference to the array of evaluate_scene elements.
  334. */
  335. const domEvaluate_scene_Array &getEvaluate_scene_array() const { return elemEvaluate_scene_array; }
  336. /**
  337. * Gets the extra element array.
  338. * @return Returns a reference to the array of extra elements.
  339. */
  340. domExtra_Array &getExtra_array() { return elemExtra_array; }
  341. /**
  342. * Gets the extra element array.
  343. * @return Returns a constant reference to the array of extra elements.
  344. */
  345. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  346. protected:
  347. /**
  348. * Constructor
  349. */
  350. domVisual_scene(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemNode_array(), elemEvaluate_scene_array(), elemExtra_array() {}
  351. /**
  352. * Destructor
  353. */
  354. virtual ~domVisual_scene() {}
  355. /**
  356. * Overloaded assignment operator
  357. */
  358. virtual domVisual_scene &operator=( const domVisual_scene &cpy ) { (void)cpy; return *this; }
  359. public: // STATIC METHODS
  360. /**
  361. * Creates an instance of this class and returns a daeElementRef referencing it.
  362. * @return a daeElementRef referencing an instance of this object.
  363. */
  364. static DLLSPEC daeElementRef create(DAE& dae);
  365. /**
  366. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  367. * If a daeMetaElement already exists it will return that instead of creating a new one.
  368. * @return A daeMetaElement describing this COLLADA element.
  369. */
  370. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  371. };
  372. #endif