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/domInstance_effect.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 domInstance_effect::create(DAE& dae) 21 { 22 domInstance_effectRef ref = new domInstance_effect(dae); 23 return ref; 24 } 25 26 27 daeMetaElement * 28 domInstance_effect::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( "instance_effect" ); 36 meta->registerClass(domInstance_effect::create); 37 38 daeMetaCMPolicy *cm = NULL; 39 daeMetaElementAttribute *mea = NULL; 40 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 41 42 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 0, -1 ); 43 mea->setName( "technique_hint" ); 44 mea->setOffset( daeOffsetOf(domInstance_effect,elemTechnique_hint_array) ); 45 mea->setElementType( domInstance_effect::domTechnique_hint::registerElement(dae) ); 46 cm->appendChild( mea ); 47 48 mea = new daeMetaElementArrayAttribute( meta, cm, 1, 0, -1 ); 49 mea->setName( "setparam" ); 50 mea->setOffset( daeOffsetOf(domInstance_effect,elemSetparam_array) ); 51 mea->setElementType( domInstance_effect::domSetparam::registerElement(dae) ); 52 cm->appendChild( mea ); 53 54 mea = new daeMetaElementArrayAttribute( meta, cm, 2, 0, -1 ); 55 mea->setName( "extra" ); 56 mea->setOffset( daeOffsetOf(domInstance_effect,elemExtra_array) ); 57 mea->setElementType( domExtra::registerElement(dae) ); 58 cm->appendChild( mea ); 59 60 cm->setMaxOrdinal( 2 ); 61 meta->setCMRoot( cm ); 62 63 // Add attribute: url 64 { 65 daeMetaAttribute *ma = new daeMetaAttribute; 66 ma->setName( "url" ); 67 ma->setType( dae.getAtomicTypes().get("xsAnyURI")); 68 ma->setOffset( daeOffsetOf( domInstance_effect , attrUrl )); 69 ma->setContainer( meta ); 70 ma->setIsRequired( true ); 71 72 meta->appendAttribute(ma); 73 } 74 75 // Add attribute: sid 76 { 77 daeMetaAttribute *ma = new daeMetaAttribute; 78 ma->setName( "sid" ); 79 ma->setType( dae.getAtomicTypes().get("xsNCName")); 80 ma->setOffset( daeOffsetOf( domInstance_effect , attrSid )); 81 ma->setContainer( meta ); 82 83 meta->appendAttribute(ma); 84 } 85 86 // Add attribute: name 87 { 88 daeMetaAttribute *ma = new daeMetaAttribute; 89 ma->setName( "name" ); 90 ma->setType( dae.getAtomicTypes().get("xsNCName")); 91 ma->setOffset( daeOffsetOf( domInstance_effect , attrName )); 92 ma->setContainer( meta ); 93 94 meta->appendAttribute(ma); 95 } 96 97 meta->setElementSize(sizeof(domInstance_effect)); 98 meta->validate(); 99 100 return meta; 101 } 102 103 daeElementRef 104 domInstance_effect::domTechnique_hint::create(DAE& dae) 105 { 106 domInstance_effect::domTechnique_hintRef ref = new domInstance_effect::domTechnique_hint(dae); 107 return ref; 108 } 109 110 111 daeMetaElement * 112 domInstance_effect::domTechnique_hint::registerElement(DAE& dae) 113 { 114 daeMetaElement* meta = dae.getMeta(ID()); 115 if ( meta != NULL ) return meta; 116 117 meta = new daeMetaElement(dae); 118 dae.setMeta(ID(), *meta); 119 meta->setName( "technique_hint" ); 120 meta->registerClass(domInstance_effect::domTechnique_hint::create); 121 122 meta->setIsInnerClass( true ); 123 124 // Add attribute: platform 125 { 126 daeMetaAttribute *ma = new daeMetaAttribute; 127 ma->setName( "platform" ); 128 ma->setType( dae.getAtomicTypes().get("xsNCName")); 129 ma->setOffset( daeOffsetOf( domInstance_effect::domTechnique_hint , attrPlatform )); 130 ma->setContainer( meta ); 131 ma->setIsRequired( false ); 132 133 meta->appendAttribute(ma); 134 } 135 136 // Add attribute: profile 137 { 138 daeMetaAttribute *ma = new daeMetaAttribute; 139 ma->setName( "profile" ); 140 ma->setType( dae.getAtomicTypes().get("xsNCName")); 141 ma->setOffset( daeOffsetOf( domInstance_effect::domTechnique_hint , attrProfile )); 142 ma->setContainer( meta ); 143 ma->setIsRequired( false ); 144 145 meta->appendAttribute(ma); 146 } 147 148 // Add attribute: ref 149 { 150 daeMetaAttribute *ma = new daeMetaAttribute; 151 ma->setName( "ref" ); 152 ma->setType( dae.getAtomicTypes().get("xsNCName")); 153 ma->setOffset( daeOffsetOf( domInstance_effect::domTechnique_hint , attrRef )); 154 ma->setContainer( meta ); 155 ma->setIsRequired( true ); 156 157 meta->appendAttribute(ma); 158 } 159 160 meta->setElementSize(sizeof(domInstance_effect::domTechnique_hint)); 161 meta->validate(); 162 163 return meta; 164 } 165 166 daeElementRef 167 domInstance_effect::domSetparam::create(DAE& dae) 168 { 169 domInstance_effect::domSetparamRef ref = new domInstance_effect::domSetparam(dae); 170 return ref; 171 } 172 173 174 daeMetaElement * 175 domInstance_effect::domSetparam::registerElement(DAE& dae) 176 { 177 daeMetaElement* meta = dae.getMeta(ID()); 178 if ( meta != NULL ) return meta; 179 180 meta = new daeMetaElement(dae); 181 dae.setMeta(ID(), *meta); 182 meta->setName( "setparam" ); 183 meta->registerClass(domInstance_effect::domSetparam::create); 184 185 meta->setIsInnerClass( true ); 186 daeMetaCMPolicy *cm = NULL; 187 daeMetaElementAttribute *mea = NULL; 188 cm = new daeMetaSequence( meta, cm, 0, 1, 1 ); 189 190 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 191 mea->setName( "fx_basic_type_common" ); 192 mea->setOffset( daeOffsetOf(domInstance_effect::domSetparam,elemFx_basic_type_common) ); 193 mea->setElementType( domFx_basic_type_common::registerElement(dae) ); 194 cm->appendChild( new daeMetaGroup( mea, meta, cm, 0, 1, 1 ) ); 195 196 cm->setMaxOrdinal( 0 ); 197 meta->setCMRoot( cm ); 198 199 // Add attribute: ref 200 { 201 daeMetaAttribute *ma = new daeMetaAttribute; 202 ma->setName( "ref" ); 203 ma->setType( dae.getAtomicTypes().get("xsToken")); 204 ma->setOffset( daeOffsetOf( domInstance_effect::domSetparam , attrRef )); 205 ma->setContainer( meta ); 206 ma->setIsRequired( true ); 207 208 meta->appendAttribute(ma); 209 } 210 211 meta->setElementSize(sizeof(domInstance_effect::domSetparam)); 212 meta->validate(); 213 214 return meta; 215 } 216 217