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