1/* 2* Copyright 2006 Sony Computer Entertainment Inc. 3* 4* Licensed under the MIT Open Source License, for details please see license.txt or the website 5* http://www.opensource.org/licenses/mit-license.php 6* 7*/ 8 9#include <dae.h> 10#include <dae/daeDom.h> 11#include <dom/domFx_surface_common.h> 12#include <dae/daeMetaCMPolicy.h> 13#include <dae/daeMetaSequence.h> 14#include <dae/daeMetaChoice.h> 15#include <dae/daeMetaGroup.h> 16#include <dae/daeMetaAny.h> 17#include <dae/daeMetaElementAttribute.h> 18 19daeElementRef 20domFx_surface_common::create(DAE& dae) 21{ 22 domFx_surface_commonRef ref = new domFx_surface_common(dae); 23 return ref; 24} 25 26 27daeMetaElement * 28domFx_surface_common::registerElement(DAE& dae) 29{ 30 daeMetaElement* meta = dae.getMeta(ID()); 31 if ( meta != NULL ) return meta; 32 33 meta = new daeMetaElement(dae); 34 dae.setMeta(ID(), *meta); 35 meta->setName( "fx_surface_common" ); 36 meta->registerClass(domFx_surface_common::create); 37 38 daeMetaCMPolicy *cm = NULL; 39 daeMetaElementAttribute *mea = NULL; 40 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 41 42 mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 ); 43 mea->setName( "fx_surface_init_common" ); 44 mea->setOffset( daeOffsetOf(domFx_surface_common,elemFx_surface_init_common) ); 45 mea->setElementType( domFx_surface_init_common::registerElement(dae) ); 46 cm->appendChild( new daeMetaGroup( mea, meta, cm, 0, 0, 1 ) ); 47 48 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 49 mea->setName( "format" ); 50 mea->setOffset( daeOffsetOf(domFx_surface_common,elemFormat) ); 51 mea->setElementType( domFx_surface_common::domFormat::registerElement(dae) ); 52 cm->appendChild( mea ); 53 54 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 ); 55 mea->setName( "format_hint" ); 56 mea->setOffset( daeOffsetOf(domFx_surface_common,elemFormat_hint) ); 57 mea->setElementType( domFx_surface_format_hint_common::registerElement(dae) ); 58 cm->appendChild( mea ); 59 60 cm = new daeMetaChoice( meta, cm, 0, 3, 0, 1 ); 61 62 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 63 mea->setName( "size" ); 64 mea->setOffset( daeOffsetOf(domFx_surface_common,elemSize) ); 65 mea->setElementType( domFx_surface_common::domSize::registerElement(dae) ); 66 cm->appendChild( mea ); 67 68 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 69 mea->setName( "viewport_ratio" ); 70 mea->setOffset( daeOffsetOf(domFx_surface_common,elemViewport_ratio) ); 71 mea->setElementType( domFx_surface_common::domViewport_ratio::registerElement(dae) ); 72 cm->appendChild( mea ); 73 74 cm->setMaxOrdinal( 0 ); 75 cm->getParent()->appendChild( cm ); 76 cm = cm->getParent(); 77 78 mea = new daeMetaElementAttribute( meta, cm, 4, 0, 1 ); 79 mea->setName( "mip_levels" ); 80 mea->setOffset( daeOffsetOf(domFx_surface_common,elemMip_levels) ); 81 mea->setElementType( domFx_surface_common::domMip_levels::registerElement(dae) ); 82 cm->appendChild( mea ); 83 84 mea = new daeMetaElementAttribute( meta, cm, 5, 0, 1 ); 85 mea->setName( "mipmap_generate" ); 86 mea->setOffset( daeOffsetOf(domFx_surface_common,elemMipmap_generate) ); 87 mea->setElementType( domFx_surface_common::domMipmap_generate::registerElement(dae) ); 88 cm->appendChild( mea ); 89 90 mea = new daeMetaElementArrayAttribute( meta, cm, 6, 0, -1 ); 91 mea->setName( "extra" ); 92 mea->setOffset( daeOffsetOf(domFx_surface_common,elemExtra_array) ); 93 mea->setElementType( domExtra::registerElement(dae) ); 94 cm->appendChild( mea ); 95 96 cm->setMaxOrdinal( 6 ); 97 meta->setCMRoot( cm ); 98 // Ordered list of sub-elements 99 meta->addContents(daeOffsetOf(domFx_surface_common,_contents)); 100 meta->addContentsOrder(daeOffsetOf(domFx_surface_common,_contentsOrder)); 101 102 meta->addCMDataArray(daeOffsetOf(domFx_surface_common,_CMData), 1); 103 // Add attribute: type 104 { 105 daeMetaAttribute *ma = new daeMetaAttribute; 106 ma->setName( "type" ); 107 ma->setType( dae.getAtomicTypes().get("Fx_surface_type_enum")); 108 ma->setOffset( daeOffsetOf( domFx_surface_common , attrType )); 109 ma->setContainer( meta ); 110 ma->setIsRequired( true ); 111 112 meta->appendAttribute(ma); 113 } 114 115 meta->setElementSize(sizeof(domFx_surface_common)); 116 meta->validate(); 117 118 return meta; 119} 120 121daeElementRef 122domFx_surface_common::domFormat::create(DAE& dae) 123{ 124 domFx_surface_common::domFormatRef ref = new domFx_surface_common::domFormat(dae); 125 return ref; 126} 127 128 129daeMetaElement * 130domFx_surface_common::domFormat::registerElement(DAE& dae) 131{ 132 daeMetaElement* meta = dae.getMeta(ID()); 133 if ( meta != NULL ) return meta; 134 135 meta = new daeMetaElement(dae); 136 dae.setMeta(ID(), *meta); 137 meta->setName( "format" ); 138 meta->registerClass(domFx_surface_common::domFormat::create); 139 140 meta->setIsInnerClass( true ); 141 // Add attribute: _value 142 { 143 daeMetaAttribute *ma = new daeMetaAttribute; 144 ma->setName( "_value" ); 145 ma->setType( dae.getAtomicTypes().get("xsToken")); 146 ma->setOffset( daeOffsetOf( domFx_surface_common::domFormat , _value )); 147 ma->setContainer( meta ); 148 meta->appendAttribute(ma); 149 } 150 151 meta->setElementSize(sizeof(domFx_surface_common::domFormat)); 152 meta->validate(); 153 154 return meta; 155} 156 157daeElementRef 158domFx_surface_common::domSize::create(DAE& dae) 159{ 160 domFx_surface_common::domSizeRef ref = new domFx_surface_common::domSize(dae); 161 return ref; 162} 163 164 165daeMetaElement * 166domFx_surface_common::domSize::registerElement(DAE& dae) 167{ 168 daeMetaElement* meta = dae.getMeta(ID()); 169 if ( meta != NULL ) return meta; 170 171 meta = new daeMetaElement(dae); 172 dae.setMeta(ID(), *meta); 173 meta->setName( "size" ); 174 meta->registerClass(domFx_surface_common::domSize::create); 175 176 meta->setIsInnerClass( true ); 177 // Add attribute: _value 178 { 179 daeMetaAttribute *ma = new daeMetaArrayAttribute; 180 ma->setName( "_value" ); 181 ma->setType( dae.getAtomicTypes().get("Int3")); 182 ma->setOffset( daeOffsetOf( domFx_surface_common::domSize , _value )); 183 ma->setContainer( meta ); 184 meta->appendAttribute(ma); 185 } 186 187 meta->setElementSize(sizeof(domFx_surface_common::domSize)); 188 meta->validate(); 189 190 return meta; 191} 192 193daeElementRef 194domFx_surface_common::domViewport_ratio::create(DAE& dae) 195{ 196 domFx_surface_common::domViewport_ratioRef ref = new domFx_surface_common::domViewport_ratio(dae); 197 return ref; 198} 199 200 201daeMetaElement * 202domFx_surface_common::domViewport_ratio::registerElement(DAE& dae) 203{ 204 daeMetaElement* meta = dae.getMeta(ID()); 205 if ( meta != NULL ) return meta; 206 207 meta = new daeMetaElement(dae); 208 dae.setMeta(ID(), *meta); 209 meta->setName( "viewport_ratio" ); 210 meta->registerClass(domFx_surface_common::domViewport_ratio::create); 211 212 meta->setIsInnerClass( true ); 213 // Add attribute: _value 214 { 215 daeMetaAttribute *ma = new daeMetaArrayAttribute; 216 ma->setName( "_value" ); 217 ma->setType( dae.getAtomicTypes().get("Float2")); 218 ma->setOffset( daeOffsetOf( domFx_surface_common::domViewport_ratio , _value )); 219 ma->setContainer( meta ); 220 meta->appendAttribute(ma); 221 } 222 223 meta->setElementSize(sizeof(domFx_surface_common::domViewport_ratio)); 224 meta->validate(); 225 226 return meta; 227} 228 229daeElementRef 230domFx_surface_common::domMip_levels::create(DAE& dae) 231{ 232 domFx_surface_common::domMip_levelsRef ref = new domFx_surface_common::domMip_levels(dae); 233 return ref; 234} 235 236 237daeMetaElement * 238domFx_surface_common::domMip_levels::registerElement(DAE& dae) 239{ 240 daeMetaElement* meta = dae.getMeta(ID()); 241 if ( meta != NULL ) return meta; 242 243 meta = new daeMetaElement(dae); 244 dae.setMeta(ID(), *meta); 245 meta->setName( "mip_levels" ); 246 meta->registerClass(domFx_surface_common::domMip_levels::create); 247 248 meta->setIsInnerClass( true ); 249 // Add attribute: _value 250 { 251 daeMetaAttribute *ma = new daeMetaAttribute; 252 ma->setName( "_value" ); 253 ma->setType( dae.getAtomicTypes().get("xsUnsignedInt")); 254 ma->setOffset( daeOffsetOf( domFx_surface_common::domMip_levels , _value )); 255 ma->setContainer( meta ); 256 meta->appendAttribute(ma); 257 } 258 259 meta->setElementSize(sizeof(domFx_surface_common::domMip_levels)); 260 meta->validate(); 261 262 return meta; 263} 264 265daeElementRef 266domFx_surface_common::domMipmap_generate::create(DAE& dae) 267{ 268 domFx_surface_common::domMipmap_generateRef ref = new domFx_surface_common::domMipmap_generate(dae); 269 return ref; 270} 271 272 273daeMetaElement * 274domFx_surface_common::domMipmap_generate::registerElement(DAE& dae) 275{ 276 daeMetaElement* meta = dae.getMeta(ID()); 277 if ( meta != NULL ) return meta; 278 279 meta = new daeMetaElement(dae); 280 dae.setMeta(ID(), *meta); 281 meta->setName( "mipmap_generate" ); 282 meta->registerClass(domFx_surface_common::domMipmap_generate::create); 283 284 meta->setIsInnerClass( true ); 285 // Add attribute: _value 286 { 287 daeMetaAttribute *ma = new daeMetaAttribute; 288 ma->setName( "_value" ); 289 ma->setType( dae.getAtomicTypes().get("xsBoolean")); 290 ma->setOffset( daeOffsetOf( domFx_surface_common::domMipmap_generate , _value )); 291 ma->setContainer( meta ); 292 meta->appendAttribute(ma); 293 } 294 295 meta->setElementSize(sizeof(domFx_surface_common::domMipmap_generate)); 296 meta->validate(); 297 298 return meta; 299} 300 301