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/domCommon_float_or_param_type.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 domCommon_float_or_param_type::create(DAE& dae) 21 { 22 domCommon_float_or_param_typeRef ref = new domCommon_float_or_param_type(dae); 23 return ref; 24 } 25 26 27 daeMetaElement * 28 domCommon_float_or_param_type::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( "common_float_or_param_type" ); 36 meta->registerClass(domCommon_float_or_param_type::create); 37 38 daeMetaCMPolicy *cm = NULL; 39 daeMetaElementAttribute *mea = NULL; 40 cm = new daeMetaChoice( meta, cm, 0, 0, 1, 1 ); 41 42 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 43 mea->setName( "float" ); 44 mea->setOffset( daeOffsetOf(domCommon_float_or_param_type,elemFloat) ); 45 mea->setElementType( domCommon_float_or_param_type::domFloat::registerElement(dae) ); 46 cm->appendChild( mea ); 47 48 mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 ); 49 mea->setName( "param" ); 50 mea->setOffset( daeOffsetOf(domCommon_float_or_param_type,elemParam) ); 51 mea->setElementType( domCommon_float_or_param_type::domParam::registerElement(dae) ); 52 cm->appendChild( mea ); 53 54 cm->setMaxOrdinal( 0 ); 55 meta->setCMRoot( cm ); 56 // Ordered list of sub-elements 57 meta->addContents(daeOffsetOf(domCommon_float_or_param_type,_contents)); 58 meta->addContentsOrder(daeOffsetOf(domCommon_float_or_param_type,_contentsOrder)); 59 60 meta->addCMDataArray(daeOffsetOf(domCommon_float_or_param_type,_CMData), 1); 61 meta->setElementSize(sizeof(domCommon_float_or_param_type)); 62 meta->validate(); 63 64 return meta; 65 } 66 67 daeElementRef 68 domCommon_float_or_param_type::domFloat::create(DAE& dae) 69 { 70 domCommon_float_or_param_type::domFloatRef ref = new domCommon_float_or_param_type::domFloat(dae); 71 return ref; 72 } 73 74 75 daeMetaElement * 76 domCommon_float_or_param_type::domFloat::registerElement(DAE& dae) 77 { 78 daeMetaElement* meta = dae.getMeta(ID()); 79 if ( meta != NULL ) return meta; 80 81 meta = new daeMetaElement(dae); 82 dae.setMeta(ID(), *meta); 83 meta->setName( "float" ); 84 meta->registerClass(domCommon_float_or_param_type::domFloat::create); 85 86 meta->setIsInnerClass( true ); 87 // Add attribute: _value 88 { 89 daeMetaAttribute *ma = new daeMetaAttribute; 90 ma->setName( "_value" ); 91 ma->setType( dae.getAtomicTypes().get("Float")); 92 ma->setOffset( daeOffsetOf( domCommon_float_or_param_type::domFloat , _value )); 93 ma->setContainer( meta ); 94 meta->appendAttribute(ma); 95 } 96 97 // Add attribute: sid 98 { 99 daeMetaAttribute *ma = new daeMetaAttribute; 100 ma->setName( "sid" ); 101 ma->setType( dae.getAtomicTypes().get("xsNCName")); 102 ma->setOffset( daeOffsetOf( domCommon_float_or_param_type::domFloat , attrSid )); 103 ma->setContainer( meta ); 104 105 meta->appendAttribute(ma); 106 } 107 108 meta->setElementSize(sizeof(domCommon_float_or_param_type::domFloat)); 109 meta->validate(); 110 111 return meta; 112 } 113 114 daeElementRef 115 domCommon_float_or_param_type::domParam::create(DAE& dae) 116 { 117 domCommon_float_or_param_type::domParamRef ref = new domCommon_float_or_param_type::domParam(dae); 118 return ref; 119 } 120 121 122 daeMetaElement * 123 domCommon_float_or_param_type::domParam::registerElement(DAE& dae) 124 { 125 daeMetaElement* meta = dae.getMeta(ID()); 126 if ( meta != NULL ) return meta; 127 128 meta = new daeMetaElement(dae); 129 dae.setMeta(ID(), *meta); 130 meta->setName( "param" ); 131 meta->registerClass(domCommon_float_or_param_type::domParam::create); 132 133 meta->setIsInnerClass( true ); 134 135 // Add attribute: ref 136 { 137 daeMetaAttribute *ma = new daeMetaAttribute; 138 ma->setName( "ref" ); 139 ma->setType( dae.getAtomicTypes().get("xsNCName")); 140 ma->setOffset( daeOffsetOf( domCommon_float_or_param_type::domParam , attrRef )); 141 ma->setContainer( meta ); 142 ma->setIsRequired( true ); 143 144 meta->appendAttribute(ma); 145 } 146 147 meta->setElementSize(sizeof(domCommon_float_or_param_type::domParam)); 148 meta->validate(); 149 150 return meta; 151 } 152 153