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 __domBind_material_h__ 10 #define __domBind_material_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 #include <dom/domParam.h> 17 #include <dom/domTechnique.h> 18 #include <dom/domExtra.h> 19 #include <dom/domInstance_material.h> 20 class DAE; 21 22 /** 23 * Bind a specific material to a piece of geometry, binding varying and uniform 24 * parameters at the same time. 25 */ 26 class domBind_material : public daeElement 27 { 28 public: 29 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND_MATERIAL; } 30 static daeInt ID() { return 686; } 31 virtual daeInt typeID() const { return ID(); } 32 public: 33 class domTechnique_common; 34 35 typedef daeSmartRef<domTechnique_common> domTechnique_commonRef; 36 typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array; 37 38 /** 39 * The technique_common element specifies the bind_material information for 40 * the common profile which all COLLADA implementations need to support. 41 */ 42 class domTechnique_common : public daeElement 43 { 44 public: 45 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; } 46 static daeInt ID() { return 687; } 47 virtual daeInt typeID() const { return ID(); } 48 49 protected: // Element 50 /** 51 * The instance_material element specifies the information needed to bind 52 * a geometry to a material. This element must appear at least once. @see 53 * domInstance_material 54 */ 55 domInstance_material_Array elemInstance_material_array; 56 57 public: //Accessors and Mutators 58 /** 59 * Gets the instance_material element array. 60 * @return Returns a reference to the array of instance_material elements. 61 */ 62 domInstance_material_Array &getInstance_material_array() { return elemInstance_material_array; } 63 /** 64 * Gets the instance_material element array. 65 * @return Returns a constant reference to the array of instance_material elements. 66 */ 67 const domInstance_material_Array &getInstance_material_array() const { return elemInstance_material_array; } 68 protected: 69 /** 70 * Constructor 71 */ 72 domTechnique_common(DAE& dae) : daeElement(dae), elemInstance_material_array() {} 73 /** 74 * Destructor 75 */ 76 virtual ~domTechnique_common() {} 77 /** 78 * Overloaded assignment operator 79 */ 80 virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; } 81 82 public: // STATIC METHODS 83 /** 84 * Creates an instance of this class and returns a daeElementRef referencing it. 85 * @return a daeElementRef referencing an instance of this object. 86 */ 87 static DLLSPEC daeElementRef create(DAE& dae); 88 /** 89 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 90 * If a daeMetaElement already exists it will return that instead of creating a new one. 91 * @return A daeMetaElement describing this COLLADA element. 92 */ 93 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 94 }; 95 96 97 98 protected: // Elements 99 /** 100 * The bind_material element may contain any number of param elements. @see 101 * domParam 102 */ 103 domParam_Array elemParam_array; 104 /** 105 * The technique_common element specifies the bind_material information for 106 * the common profile which all COLLADA implementations need to support. 107 * @see domTechnique_common 108 */ 109 domTechnique_commonRef elemTechnique_common; 110 /** 111 * This element may contain any number of non-common profile techniques. 112 * @see domTechnique 113 */ 114 domTechnique_Array elemTechnique_array; 115 /** 116 * The extra element may appear any number of times. @see domExtra 117 */ 118 domExtra_Array elemExtra_array; 119 120 public: //Accessors and Mutators 121 /** 122 * Gets the param element array. 123 * @return Returns a reference to the array of param elements. 124 */ 125 domParam_Array &getParam_array() { return elemParam_array; } 126 /** 127 * Gets the param element array. 128 * @return Returns a constant reference to the array of param elements. 129 */ 130 const domParam_Array &getParam_array() const { return elemParam_array; } 131 /** 132 * Gets the technique_common element. 133 * @return a daeSmartRef to the technique_common element. 134 */ 135 const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; } 136 /** 137 * Gets the technique element array. 138 * @return Returns a reference to the array of technique elements. 139 */ 140 domTechnique_Array &getTechnique_array() { return elemTechnique_array; } 141 /** 142 * Gets the technique element array. 143 * @return Returns a constant reference to the array of technique elements. 144 */ 145 const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; } 146 /** 147 * Gets the extra element array. 148 * @return Returns a reference to the array of extra elements. 149 */ 150 domExtra_Array &getExtra_array() { return elemExtra_array; } 151 /** 152 * Gets the extra element array. 153 * @return Returns a constant reference to the array of extra elements. 154 */ 155 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 156 protected: 157 /** 158 * Constructor 159 */ 160 domBind_material(DAE& dae) : daeElement(dae), elemParam_array(), elemTechnique_common(), elemTechnique_array(), elemExtra_array() {} 161 /** 162 * Destructor 163 */ 164 virtual ~domBind_material() {} 165 /** 166 * Overloaded assignment operator 167 */ 168 virtual domBind_material &operator=( const domBind_material &cpy ) { (void)cpy; return *this; } 169 170 public: // STATIC METHODS 171 /** 172 * Creates an instance of this class and returns a daeElementRef referencing it. 173 * @return a daeElementRef referencing an instance of this object. 174 */ 175 static DLLSPEC daeElementRef create(DAE& dae); 176 /** 177 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 178 * If a daeMetaElement already exists it will return that instead of creating a new one. 179 * @return A daeMetaElement describing this COLLADA element. 180 */ 181 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 182 }; 183 184 185 #endif 186