00001 #ifndef __domGlsl_program_h__ 00002 #define __domGlsl_program_h__ 00003 00004 #include <dae/daeDocument.h> 00005 #include <dom/domTypes.h> 00006 #include <dom/domElements.h> 00007 00008 #include <dom/domGlsl_shader.h> 00009 #include <dom/domGlsl_value.h> 00010 class DAE; 00011 00015 class domGlsl_program : public daeElement 00016 { 00017 public: 00018 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::GLSL_PROGRAM; } 00019 static daeInt ID() { return 232; } 00020 virtual daeInt typeID() const { return ID(); } 00021 public: 00022 class domBind_attribute; 00023 00024 typedef daeSmartRef<domBind_attribute> domBind_attributeRef; 00025 typedef daeTArray<domBind_attributeRef> domBind_attribute_Array; 00026 00032 class domBind_attribute : public daeElement 00033 { 00034 public: 00035 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND_ATTRIBUTE; } 00036 static daeInt ID() { return 233; } 00037 virtual daeInt typeID() const { return ID(); } 00038 public: 00039 class domSemantic; 00040 00041 typedef daeSmartRef<domSemantic> domSemanticRef; 00042 typedef daeTArray<domSemanticRef> domSemantic_Array; 00043 00049 class domSemantic : public daeElement 00050 { 00051 public: 00052 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SEMANTIC; } 00053 static daeInt ID() { return 234; } 00054 virtual daeInt typeID() const { return ID(); } 00055 00056 00057 public: //Accessors and Mutators 00062 xsToken getValue() const { return _value; } 00067 void setValue( xsToken val ) { *(daeStringRef*)&_value = val; } 00068 00069 protected: // Value 00073 xsToken _value; 00074 protected: 00078 domSemantic(DAE& dae) : daeElement(dae), _value() {} 00082 virtual ~domSemantic() {} 00086 virtual domSemantic &operator=( const domSemantic &cpy ) { (void)cpy; return *this; } 00087 00088 public: // STATIC METHODS 00093 static DLLSPEC daeElementRef create(DAE& dae); 00099 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00100 }; 00101 00102 00103 protected: // Attribute 00107 xsToken attrSymbol; 00108 00109 protected: // Element 00115 domSemanticRef elemSemantic; 00119 daeElementRefArray _contents; 00123 daeUIntArray _contentsOrder; 00124 00128 daeTArray< daeCharArray * > _CMData; 00129 00130 00131 public: //Accessors and Mutators 00136 xsToken getSymbol() const { return attrSymbol; } 00141 void setSymbol( xsToken atSymbol ) { *(daeStringRef*)&attrSymbol = atSymbol; _validAttributeArray[0] = true; } 00142 00147 const domSemanticRef getSemantic() const { return elemSemantic; } 00152 daeElementRefArray &getContents() { return _contents; } 00157 const daeElementRefArray &getContents() const { return _contents; } 00158 00159 protected: 00163 domBind_attribute(DAE& dae) : daeElement(dae), attrSymbol(), elemSemantic() {} 00167 virtual ~domBind_attribute() { daeElement::deleteCMDataArray(_CMData); } 00171 virtual domBind_attribute &operator=( const domBind_attribute &cpy ) { (void)cpy; return *this; } 00172 00173 public: // STATIC METHODS 00178 static DLLSPEC daeElementRef create(DAE& dae); 00184 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00185 }; 00186 00187 class domBind_uniform; 00188 00189 typedef daeSmartRef<domBind_uniform> domBind_uniformRef; 00190 typedef daeTArray<domBind_uniformRef> domBind_uniform_Array; 00191 00195 class domBind_uniform : public daeElement 00196 { 00197 public: 00198 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND_UNIFORM; } 00199 static daeInt ID() { return 235; } 00200 virtual daeInt typeID() const { return ID(); } 00201 public: 00202 class domParam; 00203 00204 typedef daeSmartRef<domParam> domParamRef; 00205 typedef daeTArray<domParamRef> domParam_Array; 00206 00210 class domParam : public daeElement 00211 { 00212 public: 00213 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PARAM; } 00214 static daeInt ID() { return 236; } 00215 virtual daeInt typeID() const { return ID(); } 00216 protected: // Attribute 00220 xsNCName attrRef; 00221 00222 00223 public: //Accessors and Mutators 00228 xsNCName getRef() const { return attrRef; } 00233 void setRef( xsNCName atRef ) { *(daeStringRef*)&attrRef = atRef; _validAttributeArray[0] = true; } 00234 00235 protected: 00239 domParam(DAE& dae) : daeElement(dae), attrRef() {} 00243 virtual ~domParam() {} 00247 virtual domParam &operator=( const domParam &cpy ) { (void)cpy; return *this; } 00248 00249 public: // STATIC METHODS 00254 static DLLSPEC daeElementRef create(DAE& dae); 00260 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00261 }; 00262 00263 00264 protected: // Attribute 00268 xsToken attrSymbol; 00269 00270 protected: // Elements 00274 domParamRef elemParam; 00275 domGlsl_valueRef elemGlsl_value; 00279 daeElementRefArray _contents; 00283 daeUIntArray _contentsOrder; 00284 00288 daeTArray< daeCharArray * > _CMData; 00289 00290 00291 public: //Accessors and Mutators 00296 xsToken getSymbol() const { return attrSymbol; } 00301 void setSymbol( xsToken atSymbol ) { *(daeStringRef*)&attrSymbol = atSymbol; _validAttributeArray[0] = true; } 00302 00307 const domParamRef getParam() const { return elemParam; } 00312 const domGlsl_valueRef getGlsl_value() const { return elemGlsl_value; } 00317 daeElementRefArray &getContents() { return _contents; } 00322 const daeElementRefArray &getContents() const { return _contents; } 00323 00324 protected: 00328 domBind_uniform(DAE& dae) : daeElement(dae), attrSymbol(), elemParam(), elemGlsl_value() {} 00332 virtual ~domBind_uniform() { daeElement::deleteCMDataArray(_CMData); } 00336 virtual domBind_uniform &operator=( const domBind_uniform &cpy ) { (void)cpy; return *this; } 00337 00338 public: // STATIC METHODS 00343 static DLLSPEC daeElementRef create(DAE& dae); 00349 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00350 }; 00351 00352 00353 00354 protected: // Elements 00358 domGlsl_shader_Array elemShader_array; 00364 domBind_attribute_Array elemBind_attribute_array; 00368 domBind_uniform_Array elemBind_uniform_array; 00369 00370 public: //Accessors and Mutators 00375 domGlsl_shader_Array &getShader_array() { return elemShader_array; } 00380 const domGlsl_shader_Array &getShader_array() const { return elemShader_array; } 00385 domBind_attribute_Array &getBind_attribute_array() { return elemBind_attribute_array; } 00390 const domBind_attribute_Array &getBind_attribute_array() const { return elemBind_attribute_array; } 00395 domBind_uniform_Array &getBind_uniform_array() { return elemBind_uniform_array; } 00400 const domBind_uniform_Array &getBind_uniform_array() const { return elemBind_uniform_array; } 00401 protected: 00405 domGlsl_program(DAE& dae) : daeElement(dae), elemShader_array(), elemBind_attribute_array(), elemBind_uniform_array() {} 00409 virtual ~domGlsl_program() {} 00413 virtual domGlsl_program &operator=( const domGlsl_program &cpy ) { (void)cpy; return *this; } 00414 00415 public: // STATIC METHODS 00420 static DLLSPEC daeElementRef create(DAE& dae); 00426 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00427 }; 00428 00429 00430 #endif