00001 #ifndef __domSource_h__ 00002 #define __domSource_h__ 00003 00004 #include <dae/daeDocument.h> 00005 #include <dom/domTypes.h> 00006 #include <dom/domElements.h> 00007 00008 #include <dom/domAsset.h> 00009 #include <dom/domToken_array.h> 00010 #include <dom/domIdref_array.h> 00011 #include <dom/domName_array.h> 00012 #include <dom/domBool_array.h> 00013 #include <dom/domFloat_array.h> 00014 #include <dom/domInt_array.h> 00015 #include <dom/domSidref_array.h> 00016 #include <dom/domAccessor.h> 00017 #include <dom/domTechnique.h> 00018 class DAE; 00019 00024 class domSource : public daeElement 00025 { 00026 public: 00027 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SOURCE; } 00028 static daeInt ID() { return 325; } 00029 virtual daeInt typeID() const { return ID(); } 00030 public: 00031 class domTechnique_common; 00032 00033 typedef daeSmartRef<domTechnique_common> domTechnique_commonRef; 00034 typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array; 00035 00040 class domTechnique_common : public daeElement 00041 { 00042 public: 00043 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; } 00044 static daeInt ID() { return 326; } 00045 virtual daeInt typeID() const { return ID(); } 00046 00047 protected: // Element 00052 domAccessorRef elemAccessor; 00053 00054 public: //Accessors and Mutators 00059 const domAccessorRef getAccessor() const { return elemAccessor; } 00060 protected: 00064 domTechnique_common(DAE& dae) : daeElement(dae), elemAccessor() {} 00068 virtual ~domTechnique_common() {} 00072 virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; } 00073 00074 public: // STATIC METHODS 00079 static DLLSPEC daeElementRef create(DAE& dae); 00085 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00086 }; 00087 00088 00089 protected: // Attributes 00095 xsID attrId; 00099 xsToken attrName; 00100 00101 protected: // Elements 00105 domAssetRef elemAsset; 00109 domToken_arrayRef elemToken_array; 00113 domIdref_arrayRef elemIDREF_array; 00117 domName_arrayRef elemName_array; 00121 domBool_arrayRef elemBool_array; 00125 domFloat_arrayRef elemFloat_array; 00129 domInt_arrayRef elemInt_array; 00130 domSidref_arrayRef elemSIDREF_array; 00135 domTechnique_commonRef elemTechnique_common; 00140 domTechnique_Array elemTechnique_array; 00144 daeElementRefArray _contents; 00148 daeUIntArray _contentsOrder; 00149 00153 daeTArray< daeCharArray * > _CMData; 00154 00155 00156 public: //Accessors and Mutators 00161 xsID getId() const { return attrId; } 00166 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; 00167 if( _document != NULL ) _document->changeElementID( this, attrId ); 00168 } 00169 00174 xsToken getName() const { return attrName; } 00179 void setName( xsToken atName ) { *(daeStringRef*)&attrName = atName;} 00180 00185 const domAssetRef getAsset() const { return elemAsset; } 00190 const domToken_arrayRef getToken_array() const { return elemToken_array; } 00195 const domIdref_arrayRef getIDREF_array() const { return elemIDREF_array; } 00200 const domName_arrayRef getName_array() const { return elemName_array; } 00205 const domBool_arrayRef getBool_array() const { return elemBool_array; } 00210 const domFloat_arrayRef getFloat_array() const { return elemFloat_array; } 00215 const domInt_arrayRef getInt_array() const { return elemInt_array; } 00220 const domSidref_arrayRef getSIDREF_array() const { return elemSIDREF_array; } 00225 const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; } 00230 domTechnique_Array &getTechnique_array() { return elemTechnique_array; } 00235 const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; } 00240 daeElementRefArray &getContents() { return _contents; } 00245 const daeElementRefArray &getContents() const { return _contents; } 00246 00247 protected: 00251 domSource(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemToken_array(), elemIDREF_array(), elemName_array(), elemBool_array(), elemFloat_array(), elemInt_array(), elemSIDREF_array(), elemTechnique_common(), elemTechnique_array() {} 00255 virtual ~domSource() { daeElement::deleteCMDataArray(_CMData); } 00259 virtual domSource &operator=( const domSource &cpy ) { (void)cpy; return *this; } 00260 00261 public: // STATIC METHODS 00266 static DLLSPEC daeElementRef create(DAE& dae); 00272 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00273 }; 00274 00275 00276 #endif