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 __domInstance_controller_h__ 10 #define __domInstance_controller_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 #include <dom/domBind_material.h> 17 #include <dom/domExtra.h> 18 class DAE; 19 20 /** 21 * The instance_controller element declares the instantiation of a COLLADA 22 * controller resource. 23 */ 24 class domInstance_controller : public daeElement 25 { 26 public: 27 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_CONTROLLER; } 28 static daeInt ID() { return 689; } 29 virtual daeInt typeID() const { return ID(); } 30 public: 31 class domSkeleton; 32 33 typedef daeSmartRef<domSkeleton> domSkeletonRef; 34 typedef daeTArray<domSkeletonRef> domSkeleton_Array; 35 36 /** 37 * The skeleton element is used to indicate where a skin controller is to 38 * start to search for the joint nodes it needs. This element is meaningless 39 * for morph controllers. 40 */ 41 class domSkeleton : public daeElement 42 { 43 public: 44 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SKELETON; } 45 static daeInt ID() { return 690; } 46 virtual daeInt typeID() const { return ID(); } 47 48 protected: // Value 49 /** 50 * The xsAnyURI value of the text data of this element. 51 */ 52 xsAnyURI _value; 53 54 public: //Accessors and Mutators 55 /** 56 * Gets the value of this element. 57 * @return Returns a xsAnyURI of the value. 58 */ 59 xsAnyURI &getValue() { return _value; } 60 /** 61 * Gets the value of this element. 62 * @return Returns a constant xsAnyURI of the value. 63 */ 64 const xsAnyURI &getValue() const { return _value; } 65 /** 66 * Sets the _value of this element. 67 * @param val The new value for this element. 68 */ 69 void setValue( const xsAnyURI &val ) { _value = val; } 70 /** 71 * Sets the _value of this element. 72 * @param val The new value for this element. 73 */ 74 void setValue( xsString val ) { _value = val; } 75 76 protected: 77 /** 78 * Constructor 79 */ 80 domSkeleton(DAE& dae) : daeElement(dae), _value(dae, *this) {} 81 /** 82 * Destructor 83 */ 84 virtual ~domSkeleton() {} 85 /** 86 * Overloaded assignment operator 87 */ 88 virtual domSkeleton &operator=( const domSkeleton &cpy ) { (void)cpy; return *this; } 89 90 public: // STATIC METHODS 91 /** 92 * Creates an instance of this class and returns a daeElementRef referencing it. 93 * @return a daeElementRef referencing an instance of this object. 94 */ 95 static DLLSPEC daeElementRef create(DAE& dae); 96 /** 97 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 98 * If a daeMetaElement already exists it will return that instead of creating a new one. 99 * @return A daeMetaElement describing this COLLADA element. 100 */ 101 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 102 }; 103 104 105 protected: // Attributes 106 /** 107 * The url attribute refers to resource. This may refer to a local resource 108 * using a relative URL fragment identifier that begins with the # 109 * character. The url attribute may refer to an external resource using an 110 * absolute or relative URL. 111 */ 112 xsAnyURI attrUrl; 113 /** 114 * The sid attribute is a text string value containing the sub-identifier 115 * of this element. This value must be unique within the scope of the parent 116 * element. Optional attribute. 117 */ 118 xsNCName attrSid; 119 /** 120 * The name attribute is the text string name of this element. Optional attribute. 121 */ 122 xsNCName attrName; 123 124 protected: // Elements 125 /** 126 * The skeleton element is used to indicate where a skin controller is to 127 * start to search for the joint nodes it needs. This element is meaningless 128 * for morph controllers. @see domSkeleton 129 */ 130 domSkeleton_Array elemSkeleton_array; 131 /** 132 * Bind a specific material to a piece of geometry, binding varying and uniform 133 * parameters at the same time. @see domBind_material 134 */ 135 domBind_materialRef elemBind_material; 136 /** 137 * The extra element may appear any number of times. @see domExtra 138 */ 139 domExtra_Array elemExtra_array; 140 141 public: //Accessors and Mutators 142 /** 143 * Gets the url attribute. 144 * @return Returns a xsAnyURI reference of the url attribute. 145 */ 146 xsAnyURI &getUrl() { return attrUrl; } 147 /** 148 * Gets the url attribute. 149 * @return Returns a constant xsAnyURI reference of the url attribute. 150 */ 151 const xsAnyURI &getUrl() const { return attrUrl; } 152 /** 153 * Sets the url attribute. 154 * @param atUrl The new value for the url attribute. 155 */ 156 void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; } 157 /** 158 * Sets the url attribute. 159 * @param atUrl The new value for the url attribute. 160 */ 161 void setUrl( xsString atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; } 162 163 /** 164 * Gets the sid attribute. 165 * @return Returns a xsNCName of the sid attribute. 166 */ 167 xsNCName getSid() const { return attrSid; } 168 /** 169 * Sets the sid attribute. 170 * @param atSid The new value for the sid attribute. 171 */ 172 void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; } 173 174 /** 175 * Gets the name attribute. 176 * @return Returns a xsNCName of the name attribute. 177 */ 178 xsNCName getName() const { return attrName; } 179 /** 180 * Sets the name attribute. 181 * @param atName The new value for the name attribute. 182 */ 183 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[2] = true; } 184 185 /** 186 * Gets the skeleton element array. 187 * @return Returns a reference to the array of skeleton elements. 188 */ 189 domSkeleton_Array &getSkeleton_array() { return elemSkeleton_array; } 190 /** 191 * Gets the skeleton element array. 192 * @return Returns a constant reference to the array of skeleton elements. 193 */ 194 const domSkeleton_Array &getSkeleton_array() const { return elemSkeleton_array; } 195 /** 196 * Gets the bind_material element. 197 * @return a daeSmartRef to the bind_material element. 198 */ 199 const domBind_materialRef getBind_material() const { return elemBind_material; } 200 /** 201 * Gets the extra element array. 202 * @return Returns a reference to the array of extra elements. 203 */ 204 domExtra_Array &getExtra_array() { return elemExtra_array; } 205 /** 206 * Gets the extra element array. 207 * @return Returns a constant reference to the array of extra elements. 208 */ 209 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 210 protected: 211 /** 212 * Constructor 213 */ 214 domInstance_controller(DAE& dae) : daeElement(dae), attrUrl(dae, *this), attrSid(), attrName(), elemSkeleton_array(), elemBind_material(), elemExtra_array() {} 215 /** 216 * Destructor 217 */ 218 virtual ~domInstance_controller() {} 219 /** 220 * Overloaded assignment operator 221 */ 222 virtual domInstance_controller &operator=( const domInstance_controller &cpy ) { (void)cpy; return *this; } 223 224 public: // STATIC METHODS 225 /** 226 * Creates an instance of this class and returns a daeElementRef referencing it. 227 * @return a daeElementRef referencing an instance of this object. 228 */ 229 static DLLSPEC daeElementRef create(DAE& dae); 230 /** 231 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 232 * If a daeMetaElement already exists it will return that instead of creating a new one. 233 * @return A daeMetaElement describing this COLLADA element. 234 */ 235 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 236 }; 237 238 239 #endif 240