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