00001 /* 00002 * Copyright 2006 Sony Computer Entertainment Inc. 00003 * 00004 * Licensed under the MIT Open Source License, for details please see license.txt or the website 00005 * http://www.opensource.org/licenses/mit-license.php 00006 * 00007 */ 00008 00009 #ifndef __domCommon_color_or_texture_type_h__ 00010 #define __domCommon_color_or_texture_type_h__ 00011 00012 #include <dae/daeDocument.h> 00013 #include <dom/domTypes.h> 00014 #include <dom/domElements.h> 00015 00016 #include <dom/domExtra.h> 00017 class DAE; 00018 00019 class domCommon_color_or_texture_type_complexType 00020 { 00021 public: 00022 class domColor; 00023 00024 typedef daeSmartRef<domColor> domColorRef; 00025 typedef daeTArray<domColorRef> domColor_Array; 00026 00027 class domColor : public daeElement 00028 { 00029 public: 00030 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::COLOR; } 00031 static daeInt ID() { return 116; } 00032 virtual daeInt typeID() const { return ID(); } 00033 protected: // Attribute 00034 xsNCName attrSid; 00035 00036 protected: // Value 00040 domFx_color_common _value; 00041 00042 public: //Accessors and Mutators 00047 xsNCName getSid() const { return attrSid; } 00052 void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; } 00053 00058 domFx_color_common &getValue() { return _value; } 00063 const domFx_color_common &getValue() const { return _value; } 00068 void setValue( const domFx_color_common &val ) { _value = val; } 00069 00070 protected: 00074 domColor(DAE& dae) : daeElement(dae), attrSid(), _value() {} 00078 virtual ~domColor() {} 00082 virtual domColor &operator=( const domColor &cpy ) { (void)cpy; return *this; } 00083 00084 public: // STATIC METHODS 00089 static DLLSPEC daeElementRef create(DAE& dae); 00095 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00096 }; 00097 00098 class domParam; 00099 00100 typedef daeSmartRef<domParam> domParamRef; 00101 typedef daeTArray<domParamRef> domParam_Array; 00102 00103 class domParam : public daeElement 00104 { 00105 public: 00106 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PARAM; } 00107 static daeInt ID() { return 117; } 00108 virtual daeInt typeID() const { return ID(); } 00109 protected: // Attribute 00110 xsNCName attrRef; 00111 00112 00113 public: //Accessors and Mutators 00118 xsNCName getRef() const { return attrRef; } 00123 void setRef( xsNCName atRef ) { *(daeStringRef*)&attrRef = atRef; _validAttributeArray[0] = true; } 00124 00125 protected: 00129 domParam(DAE& dae) : daeElement(dae), attrRef() {} 00133 virtual ~domParam() {} 00137 virtual domParam &operator=( const domParam &cpy ) { (void)cpy; return *this; } 00138 00139 public: // STATIC METHODS 00144 static DLLSPEC daeElementRef create(DAE& dae); 00150 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00151 }; 00152 00153 class domTexture; 00154 00155 typedef daeSmartRef<domTexture> domTextureRef; 00156 typedef daeTArray<domTextureRef> domTexture_Array; 00157 00158 class domTexture : public daeElement 00159 { 00160 public: 00161 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TEXTURE; } 00162 static daeInt ID() { return 118; } 00163 virtual daeInt typeID() const { return ID(); } 00164 protected: // Attributes 00165 xsNCName attrTexture; 00166 xsNCName attrTexcoord; 00167 00168 protected: // Element 00169 domExtraRef elemExtra; 00170 00171 public: //Accessors and Mutators 00176 xsNCName getTexture() const { return attrTexture; } 00181 void setTexture( xsNCName atTexture ) { *(daeStringRef*)&attrTexture = atTexture; _validAttributeArray[0] = true; } 00182 00187 xsNCName getTexcoord() const { return attrTexcoord; } 00192 void setTexcoord( xsNCName atTexcoord ) { *(daeStringRef*)&attrTexcoord = atTexcoord; _validAttributeArray[1] = true; } 00193 00198 const domExtraRef getExtra() const { return elemExtra; } 00199 protected: 00203 domTexture(DAE& dae) : daeElement(dae), attrTexture(), attrTexcoord(), elemExtra() {} 00207 virtual ~domTexture() {} 00211 virtual domTexture &operator=( const domTexture &cpy ) { (void)cpy; return *this; } 00212 00213 public: // STATIC METHODS 00218 static DLLSPEC daeElementRef create(DAE& dae); 00224 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00225 }; 00226 00227 00228 00229 protected: // Elements 00230 domColorRef elemColor; 00231 domParamRef elemParam; 00232 domTextureRef elemTexture; 00236 daeElementRefArray _contents; 00240 daeUIntArray _contentsOrder; 00241 00245 daeTArray< daeCharArray * > _CMData; 00246 00247 00248 public: //Accessors and Mutators 00253 const domColorRef getColor() const { return elemColor; } 00258 const domParamRef getParam() const { return elemParam; } 00263 const domTextureRef getTexture() const { return elemTexture; } 00268 daeElementRefArray &getContents() { return _contents; } 00273 const daeElementRefArray &getContents() const { return _contents; } 00274 00275 protected: 00279 domCommon_color_or_texture_type_complexType(DAE& dae, daeElement* elt) : elemColor(), elemParam(), elemTexture() {} 00283 virtual ~domCommon_color_or_texture_type_complexType() { daeElement::deleteCMDataArray(_CMData); } 00287 virtual domCommon_color_or_texture_type_complexType &operator=( const domCommon_color_or_texture_type_complexType &cpy ) { (void)cpy; return *this; } 00288 }; 00289 00293 class domCommon_color_or_texture_type : public daeElement, public domCommon_color_or_texture_type_complexType 00294 { 00295 public: 00296 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::COMMON_COLOR_OR_TEXTURE_TYPE; } 00297 static daeInt ID() { return 119; } 00298 virtual daeInt typeID() const { return ID(); } 00299 protected: 00303 domCommon_color_or_texture_type(DAE& dae) : daeElement(dae), domCommon_color_or_texture_type_complexType(dae, this) {} 00307 virtual ~domCommon_color_or_texture_type() {} 00311 virtual domCommon_color_or_texture_type &operator=( const domCommon_color_or_texture_type &cpy ) { (void)cpy; return *this; } 00312 00313 public: // STATIC METHODS 00318 static DLLSPEC daeElementRef create(DAE& dae); 00324 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00325 }; 00326 00327 00328 #endif