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_material_h__ 10 #define __domInstance_material_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 #include <dom/domExtra.h> 17 class DAE; 18 19 /** 20 * The instance_material element declares the instantiation of a COLLADA material 21 * resource. 22 */ 23 class domInstance_material : public daeElement 24 { 25 public: 26 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_MATERIAL; } 27 static daeInt ID() { return 697; } 28 virtual daeInt typeID() const { return ID(); } 29 public: 30 class domBind; 31 32 typedef daeSmartRef<domBind> domBindRef; 33 typedef daeTArray<domBindRef> domBind_Array; 34 35 /** 36 * The bind element binds values to effect parameters upon instantiation. 37 */ 38 class domBind : public daeElement 39 { 40 public: 41 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND; } 42 static daeInt ID() { return 698; } 43 virtual daeInt typeID() const { return ID(); } 44 protected: // Attributes 45 /** 46 * The semantic attribute specifies which effect parameter to bind. 47 */ 48 xsNCName attrSemantic; 49 /** 50 * The target attribute specifies the location of the value to bind to the 51 * specified semantic. This text string is a path-name following a simple 52 * syntax described in the Addressing Syntax section. 53 */ 54 xsToken attrTarget; 55 56 57 public: //Accessors and Mutators 58 /** 59 * Gets the semantic attribute. 60 * @return Returns a xsNCName of the semantic attribute. 61 */ 62 xsNCName getSemantic() const { return attrSemantic; } 63 /** 64 * Sets the semantic attribute. 65 * @param atSemantic The new value for the semantic attribute. 66 */ 67 void setSemantic( xsNCName atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[0] = true; } 68 69 /** 70 * Gets the target attribute. 71 * @return Returns a xsToken of the target attribute. 72 */ 73 xsToken getTarget() const { return attrTarget; } 74 /** 75 * Sets the target attribute. 76 * @param atTarget The new value for the target attribute. 77 */ 78 void setTarget( xsToken atTarget ) { *(daeStringRef*)&attrTarget = atTarget; _validAttributeArray[1] = true; } 79 80 protected: 81 /** 82 * Constructor 83 */ 84 domBind(DAE& dae) : daeElement(dae), attrSemantic(), attrTarget() {} 85 /** 86 * Destructor 87 */ 88 virtual ~domBind() {} 89 /** 90 * Overloaded assignment operator 91 */ 92 virtual domBind &operator=( const domBind &cpy ) { (void)cpy; return *this; } 93 94 public: // STATIC METHODS 95 /** 96 * Creates an instance of this class and returns a daeElementRef referencing it. 97 * @return a daeElementRef referencing an instance of this object. 98 */ 99 static DLLSPEC daeElementRef create(DAE& dae); 100 /** 101 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 102 * If a daeMetaElement already exists it will return that instead of creating a new one. 103 * @return A daeMetaElement describing this COLLADA element. 104 */ 105 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 106 }; 107 108 class domBind_vertex_input; 109 110 typedef daeSmartRef<domBind_vertex_input> domBind_vertex_inputRef; 111 typedef daeTArray<domBind_vertex_inputRef> domBind_vertex_input_Array; 112 113 /** 114 * The bind_vertex_input element binds vertex inputs to effect parameters 115 * upon instantiation. 116 */ 117 class domBind_vertex_input : public daeElement 118 { 119 public: 120 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND_VERTEX_INPUT; } 121 static daeInt ID() { return 699; } 122 virtual daeInt typeID() const { return ID(); } 123 protected: // Attributes 124 /** 125 * The semantic attribute specifies which effect parameter to bind. 126 */ 127 xsNCName attrSemantic; 128 /** 129 * The input_semantic attribute specifies which input semantic to bind. 130 */ 131 xsNCName attrInput_semantic; 132 /** 133 * The input_set attribute specifies which input set to bind. 134 */ 135 domUint attrInput_set; 136 137 138 public: //Accessors and Mutators 139 /** 140 * Gets the semantic attribute. 141 * @return Returns a xsNCName of the semantic attribute. 142 */ 143 xsNCName getSemantic() const { return attrSemantic; } 144 /** 145 * Sets the semantic attribute. 146 * @param atSemantic The new value for the semantic attribute. 147 */ 148 void setSemantic( xsNCName atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[0] = true; } 149 150 /** 151 * Gets the input_semantic attribute. 152 * @return Returns a xsNCName of the input_semantic attribute. 153 */ 154 xsNCName getInput_semantic() const { return attrInput_semantic; } 155 /** 156 * Sets the input_semantic attribute. 157 * @param atInput_semantic The new value for the input_semantic attribute. 158 */ 159 void setInput_semantic( xsNCName atInput_semantic ) { *(daeStringRef*)&attrInput_semantic = atInput_semantic; _validAttributeArray[1] = true; } 160 161 /** 162 * Gets the input_set attribute. 163 * @return Returns a domUint of the input_set attribute. 164 */ 165 domUint getInput_set() const { return attrInput_set; } 166 /** 167 * Sets the input_set attribute. 168 * @param atInput_set The new value for the input_set attribute. 169 */ 170 void setInput_set( domUint atInput_set ) { attrInput_set = atInput_set; _validAttributeArray[2] = true; } 171 172 protected: 173 /** 174 * Constructor 175 */ 176 domBind_vertex_input(DAE& dae) : daeElement(dae), attrSemantic(), attrInput_semantic(), attrInput_set() {} 177 /** 178 * Destructor 179 */ 180 virtual ~domBind_vertex_input() {} 181 /** 182 * Overloaded assignment operator 183 */ 184 virtual domBind_vertex_input &operator=( const domBind_vertex_input &cpy ) { (void)cpy; return *this; } 185 186 public: // STATIC METHODS 187 /** 188 * Creates an instance of this class and returns a daeElementRef referencing it. 189 * @return a daeElementRef referencing an instance of this object. 190 */ 191 static DLLSPEC daeElementRef create(DAE& dae); 192 /** 193 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 194 * If a daeMetaElement already exists it will return that instead of creating a new one. 195 * @return A daeMetaElement describing this COLLADA element. 196 */ 197 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 198 }; 199 200 201 protected: // Attributes 202 /** 203 * The symbol attribute specifies which symbol defined from within the geometry 204 * this material binds to. 205 */ 206 xsNCName attrSymbol; 207 /** 208 * The target attribute specifies the URL of the location of the object to 209 * instantiate. 210 */ 211 xsAnyURI attrTarget; 212 /** 213 * The sid attribute is a text string value containing the sub-identifier 214 * of this element. This value must be unique within the scope of the parent 215 * element. Optional attribute. 216 */ 217 xsNCName attrSid; 218 /** 219 * The name attribute is the text string name of this element. Optional attribute. 220 */ 221 xsNCName attrName; 222 223 protected: // Elements 224 /** 225 * The bind element binds values to effect parameters upon instantiation. 226 * @see domBind 227 */ 228 domBind_Array elemBind_array; 229 /** 230 * The bind_vertex_input element binds vertex inputs to effect parameters 231 * upon instantiation. @see domBind_vertex_input 232 */ 233 domBind_vertex_input_Array elemBind_vertex_input_array; 234 /** 235 * The extra element may appear any number of times. @see domExtra 236 */ 237 domExtra_Array elemExtra_array; 238 239 public: //Accessors and Mutators 240 /** 241 * Gets the symbol attribute. 242 * @return Returns a xsNCName of the symbol attribute. 243 */ 244 xsNCName getSymbol() const { return attrSymbol; } 245 /** 246 * Sets the symbol attribute. 247 * @param atSymbol The new value for the symbol attribute. 248 */ 249 void setSymbol( xsNCName atSymbol ) { *(daeStringRef*)&attrSymbol = atSymbol; _validAttributeArray[0] = true; } 250 251 /** 252 * Gets the target attribute. 253 * @return Returns a xsAnyURI reference of the target attribute. 254 */ 255 xsAnyURI &getTarget() { return attrTarget; } 256 /** 257 * Gets the target attribute. 258 * @return Returns a constant xsAnyURI reference of the target attribute. 259 */ 260 const xsAnyURI &getTarget() const { return attrTarget; } 261 /** 262 * Sets the target attribute. 263 * @param atTarget The new value for the target attribute. 264 */ 265 void setTarget( const xsAnyURI &atTarget ) { attrTarget = atTarget; _validAttributeArray[1] = true; } 266 /** 267 * Sets the target attribute. 268 * @param atTarget The new value for the target attribute. 269 */ 270 void setTarget( xsString atTarget ) { attrTarget = atTarget; _validAttributeArray[1] = true; } 271 272 /** 273 * Gets the sid attribute. 274 * @return Returns a xsNCName of the sid attribute. 275 */ 276 xsNCName getSid() const { return attrSid; } 277 /** 278 * Sets the sid attribute. 279 * @param atSid The new value for the sid attribute. 280 */ 281 void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[2] = true; } 282 283 /** 284 * Gets the name attribute. 285 * @return Returns a xsNCName of the name attribute. 286 */ 287 xsNCName getName() const { return attrName; } 288 /** 289 * Sets the name attribute. 290 * @param atName The new value for the name attribute. 291 */ 292 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[3] = true; } 293 294 /** 295 * Gets the bind element array. 296 * @return Returns a reference to the array of bind elements. 297 */ 298 domBind_Array &getBind_array() { return elemBind_array; } 299 /** 300 * Gets the bind element array. 301 * @return Returns a constant reference to the array of bind elements. 302 */ 303 const domBind_Array &getBind_array() const { return elemBind_array; } 304 /** 305 * Gets the bind_vertex_input element array. 306 * @return Returns a reference to the array of bind_vertex_input elements. 307 */ 308 domBind_vertex_input_Array &getBind_vertex_input_array() { return elemBind_vertex_input_array; } 309 /** 310 * Gets the bind_vertex_input element array. 311 * @return Returns a constant reference to the array of bind_vertex_input elements. 312 */ 313 const domBind_vertex_input_Array &getBind_vertex_input_array() const { return elemBind_vertex_input_array; } 314 /** 315 * Gets the extra element array. 316 * @return Returns a reference to the array of extra elements. 317 */ 318 domExtra_Array &getExtra_array() { return elemExtra_array; } 319 /** 320 * Gets the extra element array. 321 * @return Returns a constant reference to the array of extra elements. 322 */ 323 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 324 protected: 325 /** 326 * Constructor 327 */ 328 domInstance_material(DAE& dae) : daeElement(dae), attrSymbol(), attrTarget(dae, *this), attrSid(), attrName(), elemBind_array(), elemBind_vertex_input_array(), elemExtra_array() {} 329 /** 330 * Destructor 331 */ 332 virtual ~domInstance_material() {} 333 /** 334 * Overloaded assignment operator 335 */ 336 virtual domInstance_material &operator=( const domInstance_material &cpy ) { (void)cpy; return *this; } 337 338 public: // STATIC METHODS 339 /** 340 * Creates an instance of this class and returns a daeElementRef referencing it. 341 * @return a daeElementRef referencing an instance of this object. 342 */ 343 static DLLSPEC daeElementRef create(DAE& dae); 344 /** 345 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 346 * If a daeMetaElement already exists it will return that instead of creating a new one. 347 * @return A daeMetaElement describing this COLLADA element. 348 */ 349 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 350 }; 351 352 353 #endif 354