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/domCg_sampler2D.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 19 daeElementRef 20 domCg_sampler2D::create(DAE& dae) 21 { 22 domCg_sampler2DRef ref = new domCg_sampler2D(dae); 23 return ref; 24 } 25 26 27 daeMetaElement * 28 domCg_sampler2D::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( "cg_sampler2D" ); 36 meta->registerClass(domCg_sampler2D::create); 37 38 daeMetaCMPolicy *cm = NULL; 39 daeMetaElementAttribute *mea = NULL; 40 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 41 42 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 43 44 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 45 mea->setName( "source" ); 46 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemSource) ); 47 mea->setElementType( domSource::registerElement(dae) ); 48 cm->appendChild( mea ); 49 50 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 ); 51 mea->setName( "wrap_s" ); 52 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemWrap_s) ); 53 mea->setElementType( domWrap_s::registerElement(dae) ); 54 cm->appendChild( mea ); 55 56 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 ); 57 mea->setName( "wrap_t" ); 58 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemWrap_t) ); 59 mea->setElementType( domWrap_t::registerElement(dae) ); 60 cm->appendChild( mea ); 61 62 mea = new daeMetaElementAttribute( meta, cm, 3, 0, 1 ); 63 mea->setName( "minfilter" ); 64 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemMinfilter) ); 65 mea->setElementType( domMinfilter::registerElement(dae) ); 66 cm->appendChild( mea ); 67 68 mea = new daeMetaElementAttribute( meta, cm, 4, 0, 1 ); 69 mea->setName( "magfilter" ); 70 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemMagfilter) ); 71 mea->setElementType( domMagfilter::registerElement(dae) ); 72 cm->appendChild( mea ); 73 74 mea = new daeMetaElementAttribute( meta, cm, 5, 0, 1 ); 75 mea->setName( "mipfilter" ); 76 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemMipfilter) ); 77 mea->setElementType( domMipfilter::registerElement(dae) ); 78 cm->appendChild( mea ); 79 80 mea = new daeMetaElementAttribute( meta, cm, 6, 0, 1 ); 81 mea->setName( "border_color" ); 82 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemBorder_color) ); 83 mea->setElementType( domBorder_color::registerElement(dae) ); 84 cm->appendChild( mea ); 85 86 mea = new daeMetaElementAttribute( meta, cm, 7, 0, 1 ); 87 mea->setName( "mipmap_maxlevel" ); 88 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemMipmap_maxlevel) ); 89 mea->setElementType( domMipmap_maxlevel::registerElement(dae) ); 90 cm->appendChild( mea ); 91 92 mea = new daeMetaElementAttribute( meta, cm, 8, 0, 1 ); 93 mea->setName( "mipmap_bias" ); 94 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemMipmap_bias) ); 95 mea->setElementType( domMipmap_bias::registerElement(dae) ); 96 cm->appendChild( mea ); 97 98 mea = new daeMetaElementArrayAttribute( meta, cm, 9, 0, -1 ); 99 mea->setName( "extra" ); 100 mea->setOffset( daeOffsetOf(domCg_sampler2D,elemExtra_array) ); 101 mea->setElementType( domExtra::registerElement(dae) ); 102 cm->appendChild( mea ); 103 104 cm->setMaxOrdinal( 9 ); 105 cm->getParent()->appendChild( cm ); 106 cm = cm->getParent(); 107 108 cm->setMaxOrdinal( 9 ); 109 meta->setCMRoot( cm ); 110 111 meta->setElementSize(sizeof(domCg_sampler2D)); 112 meta->validate(); 113 114 return meta; 115 } 116 117