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 __domLibrary_physics_models_h__ 10 #define __domLibrary_physics_models_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/domPhysics_model.h> 18 #include <dom/domExtra.h> 19 class DAE; 20 21 /** 22 * The library_physics_models element declares a module of physics_model elements. 23 */ 24 class domLibrary_physics_models : public daeElement 25 { 26 public: 27 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::LIBRARY_PHYSICS_MODELS; } 28 static daeInt ID() { return 724; } 29 virtual daeInt typeID() const { return ID(); } 30 protected: // Attributes 31 /** 32 * The id attribute is a text string containing the unique identifier of 33 * this element. This value must be unique within the instance document. 34 * Optional attribute. 35 */ 36 xsID attrId; 37 /** 38 * The name attribute is the text string name of this element. Optional attribute. 39 */ 40 xsNCName attrName; 41 42 protected: // Elements 43 /** 44 * The library_physics_models element may contain an asset element. @see 45 * domAsset 46 */ 47 domAssetRef elemAsset; 48 /** 49 * There must be at least one physics_model element. @see domPhysics_model 50 */ 51 domPhysics_model_Array elemPhysics_model_array; 52 /** 53 * The extra element may appear any number of times. @see domExtra 54 */ 55 domExtra_Array elemExtra_array; 56 57 public: //Accessors and Mutators 58 /** 59 * Gets the id attribute. 60 * @return Returns a xsID of the id attribute. 61 */ 62 xsID getId() const { return attrId; } 63 /** 64 * Sets the id attribute. 65 * @param atId The new value for the id attribute. 66 */ 67 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 68 if( _document != NULL ) _document->changeElementID( this, attrId ); 69 } 70 71 /** 72 * Gets the name attribute. 73 * @return Returns a xsNCName of the name attribute. 74 */ 75 xsNCName getName() const { return attrName; } 76 /** 77 * Sets the name attribute. 78 * @param atName The new value for the name attribute. 79 */ 80 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 81 82 /** 83 * Gets the asset element. 84 * @return a daeSmartRef to the asset element. 85 */ 86 const domAssetRef getAsset() const { return elemAsset; } 87 /** 88 * Gets the physics_model element array. 89 * @return Returns a reference to the array of physics_model elements. 90 */ 91 domPhysics_model_Array &getPhysics_model_array() { return elemPhysics_model_array; } 92 /** 93 * Gets the physics_model element array. 94 * @return Returns a constant reference to the array of physics_model elements. 95 */ 96 const domPhysics_model_Array &getPhysics_model_array() const { return elemPhysics_model_array; } 97 /** 98 * Gets the extra element array. 99 * @return Returns a reference to the array of extra elements. 100 */ 101 domExtra_Array &getExtra_array() { return elemExtra_array; } 102 /** 103 * Gets the extra element array. 104 * @return Returns a constant reference to the array of extra elements. 105 */ 106 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 107 protected: 108 /** 109 * Constructor 110 */ 111 domLibrary_physics_models(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemPhysics_model_array(), elemExtra_array() {} 112 /** 113 * Destructor 114 */ 115 virtual ~domLibrary_physics_models() {} 116 /** 117 * Overloaded assignment operator 118 */ 119 virtual domLibrary_physics_models &operator=( const domLibrary_physics_models &cpy ) { (void)cpy; return *this; } 120 121 public: // STATIC METHODS 122 /** 123 * Creates an instance of this class and returns a daeElementRef referencing it. 124 * @return a daeElementRef referencing an instance of this object. 125 */ 126 static DLLSPEC daeElementRef create(DAE& dae); 127 /** 128 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 129 * If a daeMetaElement already exists it will return that instead of creating a new one. 130 * @return A daeMetaElement describing this COLLADA element. 131 */ 132 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 133 }; 134 135 136 #endif 137