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 __domImage_h__ 00010 #define __domImage_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/domExtra.h> 00018 class DAE; 00019 00027 class domImage : public daeElement 00028 { 00029 public: 00030 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::IMAGE; } 00031 static daeInt ID() { return 635; } 00032 virtual daeInt typeID() const { return ID(); } 00033 public: 00034 class domData; 00035 00036 typedef daeSmartRef<domData> domDataRef; 00037 typedef daeTArray<domDataRef> domData_Array; 00038 00043 class domData : public daeElement 00044 { 00045 public: 00046 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::DATA; } 00047 static daeInt ID() { return 636; } 00048 virtual daeInt typeID() const { return ID(); } 00049 00050 protected: // Value 00054 domListOfHexBinary _value; 00055 00056 public: //Accessors and Mutators 00061 domListOfHexBinary &getValue() { return _value; } 00066 const domListOfHexBinary &getValue() const { return _value; } 00071 void setValue( const domListOfHexBinary &val ) { _value = val; } 00072 00073 protected: 00077 domData(DAE& dae) : daeElement(dae), _value() {} 00081 virtual ~domData() {} 00085 virtual domData &operator=( const domData &cpy ) { (void)cpy; return *this; } 00086 00087 public: // STATIC METHODS 00092 static DLLSPEC daeElementRef create(DAE& dae); 00098 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00099 }; 00100 00101 class domInit_from; 00102 00103 typedef daeSmartRef<domInit_from> domInit_fromRef; 00104 typedef daeTArray<domInit_fromRef> domInit_from_Array; 00105 00110 class domInit_from : public daeElement 00111 { 00112 public: 00113 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INIT_FROM; } 00114 static daeInt ID() { return 637; } 00115 virtual daeInt typeID() const { return ID(); } 00116 00117 protected: // Value 00121 xsAnyURI _value; 00122 00123 public: //Accessors and Mutators 00128 xsAnyURI &getValue() { return _value; } 00133 const xsAnyURI &getValue() const { return _value; } 00138 void setValue( const xsAnyURI &val ) { _value = val; } 00143 void setValue( xsString val ) { _value = val; } 00144 00145 protected: 00149 domInit_from(DAE& dae) : daeElement(dae), _value(dae, *this) {} 00153 virtual ~domInit_from() {} 00157 virtual domInit_from &operator=( const domInit_from &cpy ) { (void)cpy; return *this; } 00158 00159 public: // STATIC METHODS 00164 static DLLSPEC daeElementRef create(DAE& dae); 00170 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00171 }; 00172 00173 00174 protected: // Attributes 00180 xsID attrId; 00184 xsNCName attrName; 00189 xsToken attrFormat; 00194 domUint attrHeight; 00199 domUint attrWidth; 00205 domUint attrDepth; 00206 00207 protected: // Elements 00211 domAssetRef elemAsset; 00216 domDataRef elemData; 00221 domInit_fromRef elemInit_from; 00225 domExtra_Array elemExtra_array; 00229 daeElementRefArray _contents; 00233 daeUIntArray _contentsOrder; 00234 00238 daeTArray< daeCharArray * > _CMData; 00239 00240 00241 public: //Accessors and Mutators 00246 xsID getId() const { return attrId; } 00251 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 00252 if( _document != NULL ) _document->changeElementID( this, attrId ); 00253 } 00254 00259 xsNCName getName() const { return attrName; } 00264 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 00265 00270 xsToken getFormat() const { return attrFormat; } 00275 void setFormat( xsToken atFormat ) { *(daeStringRef*)&attrFormat = atFormat; _validAttributeArray[2] = true; } 00276 00281 domUint getHeight() const { return attrHeight; } 00286 void setHeight( domUint atHeight ) { attrHeight = atHeight; _validAttributeArray[3] = true; } 00287 00292 domUint getWidth() const { return attrWidth; } 00297 void setWidth( domUint atWidth ) { attrWidth = atWidth; _validAttributeArray[4] = true; } 00298 00303 domUint getDepth() const { return attrDepth; } 00308 void setDepth( domUint atDepth ) { attrDepth = atDepth; _validAttributeArray[5] = true; } 00309 00314 const domAssetRef getAsset() const { return elemAsset; } 00319 const domDataRef getData() const { return elemData; } 00324 const domInit_fromRef getInit_from() const { return elemInit_from; } 00329 domExtra_Array &getExtra_array() { return elemExtra_array; } 00334 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 00339 daeElementRefArray &getContents() { return _contents; } 00344 const daeElementRefArray &getContents() const { return _contents; } 00345 00346 protected: 00350 domImage(DAE& dae) : daeElement(dae), attrId(), attrName(), attrFormat(), attrHeight(), attrWidth(), attrDepth(), elemAsset(), elemData(), elemInit_from(), elemExtra_array() {} 00354 virtual ~domImage() { daeElement::deleteCMDataArray(_CMData); } 00358 virtual domImage &operator=( const domImage &cpy ) { (void)cpy; return *this; } 00359 00360 public: // STATIC METHODS 00365 static DLLSPEC daeElementRef create(DAE& dae); 00371 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00372 }; 00373 00374 00375 #endif