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 __domSource_h__ 00010 #define __domSource_h__ 00011 00012 #include <dae/daeDocument.h> 00013 #include <dom/domTypes.h> 00014 #include <dom/domElements.h> 00015 00016 #include <dom/domAsset.h> 00017 #include <dom/domIDREF_array.h> 00018 #include <dom/domName_array.h> 00019 #include <dom/domBool_array.h> 00020 #include <dom/domFloat_array.h> 00021 #include <dom/domInt_array.h> 00022 #include <dom/domTechnique.h> 00023 #include <dom/domAccessor.h> 00024 class DAE; 00025 00030 class domSource : public daeElement 00031 { 00032 public: 00033 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SOURCE; } 00034 static daeInt ID() { return 611; } 00035 virtual daeInt typeID() const { return ID(); } 00036 public: 00037 class domTechnique_common; 00038 00039 typedef daeSmartRef<domTechnique_common> domTechnique_commonRef; 00040 typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array; 00041 00046 class domTechnique_common : public daeElement 00047 { 00048 public: 00049 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; } 00050 static daeInt ID() { return 612; } 00051 virtual daeInt typeID() const { return ID(); } 00052 00053 protected: // Element 00058 domAccessorRef elemAccessor; 00059 00060 public: //Accessors and Mutators 00065 const domAccessorRef getAccessor() const { return elemAccessor; } 00066 protected: 00070 domTechnique_common(DAE& dae) : daeElement(dae), elemAccessor() {} 00074 virtual ~domTechnique_common() {} 00078 virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; } 00079 00080 public: // STATIC METHODS 00085 static DLLSPEC daeElementRef create(DAE& dae); 00091 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00092 }; 00093 00094 00095 protected: // Attributes 00101 xsID attrId; 00105 xsNCName attrName; 00106 00107 protected: // Elements 00111 domAssetRef elemAsset; 00115 domIDREF_arrayRef elemIDREF_array; 00119 domName_arrayRef elemName_array; 00123 domBool_arrayRef elemBool_array; 00127 domFloat_arrayRef elemFloat_array; 00131 domInt_arrayRef elemInt_array; 00136 domTechnique_commonRef elemTechnique_common; 00141 domTechnique_Array elemTechnique_array; 00145 daeElementRefArray _contents; 00149 daeUIntArray _contentsOrder; 00150 00154 daeTArray< daeCharArray * > _CMData; 00155 00156 00157 public: //Accessors and Mutators 00162 xsID getId() const { return attrId; } 00167 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 00168 if( _document != NULL ) _document->changeElementID( this, attrId ); 00169 } 00170 00175 xsNCName getName() const { return attrName; } 00180 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 00181 00186 const domAssetRef getAsset() const { return elemAsset; } 00191 const domIDREF_arrayRef getIDREF_array() const { return elemIDREF_array; } 00196 const domName_arrayRef getName_array() const { return elemName_array; } 00201 const domBool_arrayRef getBool_array() const { return elemBool_array; } 00206 const domFloat_arrayRef getFloat_array() const { return elemFloat_array; } 00211 const domInt_arrayRef getInt_array() const { return elemInt_array; } 00216 const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; } 00221 domTechnique_Array &getTechnique_array() { return elemTechnique_array; } 00226 const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; } 00231 daeElementRefArray &getContents() { return _contents; } 00236 const daeElementRefArray &getContents() const { return _contents; } 00237 00238 protected: 00242 domSource(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemIDREF_array(), elemName_array(), elemBool_array(), elemFloat_array(), elemInt_array(), elemTechnique_common(), elemTechnique_array() {} 00246 virtual ~domSource() { daeElement::deleteCMDataArray(_CMData); } 00250 virtual domSource &operator=( const domSource &cpy ) { (void)cpy; return *this; } 00251 00252 public: // STATIC METHODS 00257 static DLLSPEC daeElementRef create(DAE& dae); 00263 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00264 }; 00265 00266 00267 #endif