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 __domPolygons_h__ 00010 #define __domPolygons_h__ 00011 00012 #include <dae/daeDocument.h> 00013 #include <dom/domTypes.h> 00014 #include <dom/domElements.h> 00015 00016 #include <dom/domP.h> 00017 #include <dom/domExtra.h> 00018 #include <dom/domInputLocalOffset.h> 00019 class DAE; 00020 00027 class domPolygons : public daeElement 00028 { 00029 public: 00030 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::POLYGONS; } 00031 static daeInt ID() { return 620; } 00032 virtual daeInt typeID() const { return ID(); } 00033 public: 00034 class domPh; 00035 00036 typedef daeSmartRef<domPh> domPhRef; 00037 typedef daeTArray<domPhRef> domPh_Array; 00038 00042 class domPh : public daeElement 00043 { 00044 public: 00045 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PH; } 00046 static daeInt ID() { return 621; } 00047 virtual daeInt typeID() const { return ID(); } 00048 public: 00049 class domH; 00050 00051 typedef daeSmartRef<domH> domHRef; 00052 typedef daeTArray<domHRef> domH_Array; 00053 00058 class domH : public daeElement 00059 { 00060 public: 00061 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::H; } 00062 static daeInt ID() { return 622; } 00063 virtual daeInt typeID() const { return ID(); } 00064 00065 protected: // Value 00069 domListOfUInts _value; 00070 00071 public: //Accessors and Mutators 00076 domListOfUInts &getValue() { return _value; } 00081 const domListOfUInts &getValue() const { return _value; } 00086 void setValue( const domListOfUInts &val ) { _value = val; } 00087 00088 protected: 00092 domH(DAE& dae) : daeElement(dae), _value() {} 00096 virtual ~domH() {} 00100 virtual domH &operator=( const domH &cpy ) { (void)cpy; return *this; } 00101 00102 public: // STATIC METHODS 00107 static DLLSPEC daeElementRef create(DAE& dae); 00113 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00114 }; 00115 00116 00117 00118 protected: // Elements 00122 domPRef elemP; 00127 domH_Array elemH_array; 00128 00129 public: //Accessors and Mutators 00134 const domPRef getP() const { return elemP; } 00139 domH_Array &getH_array() { return elemH_array; } 00144 const domH_Array &getH_array() const { return elemH_array; } 00145 protected: 00149 domPh(DAE& dae) : daeElement(dae), elemP(), elemH_array() {} 00153 virtual ~domPh() {} 00157 virtual domPh &operator=( const domPh &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 00178 xsNCName attrName; 00183 domUint attrCount; 00190 xsNCName attrMaterial; 00191 00192 protected: // Elements 00197 domInputLocalOffset_Array elemInput_array; 00201 domP_Array elemP_array; 00205 domPh_Array elemPh_array; 00209 domExtra_Array elemExtra_array; 00213 daeElementRefArray _contents; 00217 daeUIntArray _contentsOrder; 00218 00222 daeTArray< daeCharArray * > _CMData; 00223 00224 00225 public: //Accessors and Mutators 00230 xsNCName getName() const { return attrName; } 00235 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[0] = true; } 00236 00241 domUint getCount() const { return attrCount; } 00246 void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[1] = true; } 00247 00252 xsNCName getMaterial() const { return attrMaterial; } 00257 void setMaterial( xsNCName atMaterial ) { *(daeStringRef*)&attrMaterial = atMaterial; _validAttributeArray[2] = true; } 00258 00263 domInputLocalOffset_Array &getInput_array() { return elemInput_array; } 00268 const domInputLocalOffset_Array &getInput_array() const { return elemInput_array; } 00273 domP_Array &getP_array() { return elemP_array; } 00278 const domP_Array &getP_array() const { return elemP_array; } 00283 domPh_Array &getPh_array() { return elemPh_array; } 00288 const domPh_Array &getPh_array() const { return elemPh_array; } 00293 domExtra_Array &getExtra_array() { return elemExtra_array; } 00298 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 00303 daeElementRefArray &getContents() { return _contents; } 00308 const daeElementRefArray &getContents() const { return _contents; } 00309 00310 protected: 00314 domPolygons(DAE& dae) : daeElement(dae), attrName(), attrCount(), attrMaterial(), elemInput_array(), elemP_array(), elemPh_array(), elemExtra_array() {} 00318 virtual ~domPolygons() { daeElement::deleteCMDataArray(_CMData); } 00322 virtual domPolygons &operator=( const domPolygons &cpy ) { (void)cpy; return *this; } 00323 00324 public: // STATIC METHODS 00329 static DLLSPEC daeElementRef create(DAE& dae); 00335 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00336 }; 00337 00338 00339 #endif