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/domGles_newparam.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
create(DAE & dae)20 domGles_newparam::create(DAE& dae)
21 {
22 domGles_newparamRef ref = new domGles_newparam(dae);
23 return ref;
24 }
25
26
27 daeMetaElement *
registerElement(DAE & dae)28 domGles_newparam::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( "gles_newparam" );
36 meta->registerClass(domGles_newparam::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( "annotate" );
44 mea->setOffset( daeOffsetOf(domGles_newparam,elemAnnotate_array) );
45 mea->setElementType( domFx_annotate_common::registerElement(dae) );
46 cm->appendChild( mea );
47
48 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
49 mea->setName( "semantic" );
50 mea->setOffset( daeOffsetOf(domGles_newparam,elemSemantic) );
51 mea->setElementType( domGles_newparam::domSemantic::registerElement(dae) );
52 cm->appendChild( mea );
53
54 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 );
55 mea->setName( "modifier" );
56 mea->setOffset( daeOffsetOf(domGles_newparam,elemModifier) );
57 mea->setElementType( domGles_newparam::domModifier::registerElement(dae) );
58 cm->appendChild( mea );
59
60 mea = new daeMetaElementAttribute( meta, cm, 3, 1, 1 );
61 mea->setName( "gles_basic_type_common" );
62 mea->setOffset( daeOffsetOf(domGles_newparam,elemGles_basic_type_common) );
63 mea->setElementType( domGles_basic_type_common::registerElement(dae) );
64 cm->appendChild( new daeMetaGroup( mea, meta, cm, 3, 1, 1 ) );
65
66 cm->setMaxOrdinal( 3 );
67 meta->setCMRoot( cm );
68
69 // Add attribute: sid
70 {
71 daeMetaAttribute *ma = new daeMetaAttribute;
72 ma->setName( "sid" );
73 ma->setType( dae.getAtomicTypes().get("xsNCName"));
74 ma->setOffset( daeOffsetOf( domGles_newparam , attrSid ));
75 ma->setContainer( meta );
76 ma->setIsRequired( true );
77
78 meta->appendAttribute(ma);
79 }
80
81 meta->setElementSize(sizeof(domGles_newparam));
82 meta->validate();
83
84 return meta;
85 }
86
87 daeElementRef
create(DAE & dae)88 domGles_newparam::domSemantic::create(DAE& dae)
89 {
90 domGles_newparam::domSemanticRef ref = new domGles_newparam::domSemantic(dae);
91 return ref;
92 }
93
94
95 daeMetaElement *
registerElement(DAE & dae)96 domGles_newparam::domSemantic::registerElement(DAE& dae)
97 {
98 daeMetaElement* meta = dae.getMeta(ID());
99 if ( meta != NULL ) return meta;
100
101 meta = new daeMetaElement(dae);
102 dae.setMeta(ID(), *meta);
103 meta->setName( "semantic" );
104 meta->registerClass(domGles_newparam::domSemantic::create);
105
106 meta->setIsInnerClass( true );
107 // Add attribute: _value
108 {
109 daeMetaAttribute *ma = new daeMetaAttribute;
110 ma->setName( "_value" );
111 ma->setType( dae.getAtomicTypes().get("xsNCName"));
112 ma->setOffset( daeOffsetOf( domGles_newparam::domSemantic , _value ));
113 ma->setContainer( meta );
114 meta->appendAttribute(ma);
115 }
116
117 meta->setElementSize(sizeof(domGles_newparam::domSemantic));
118 meta->validate();
119
120 return meta;
121 }
122
123 daeElementRef
create(DAE & dae)124 domGles_newparam::domModifier::create(DAE& dae)
125 {
126 domGles_newparam::domModifierRef ref = new domGles_newparam::domModifier(dae);
127 return ref;
128 }
129
130
131 daeMetaElement *
registerElement(DAE & dae)132 domGles_newparam::domModifier::registerElement(DAE& dae)
133 {
134 daeMetaElement* meta = dae.getMeta(ID());
135 if ( meta != NULL ) return meta;
136
137 meta = new daeMetaElement(dae);
138 dae.setMeta(ID(), *meta);
139 meta->setName( "modifier" );
140 meta->registerClass(domGles_newparam::domModifier::create);
141
142 meta->setIsInnerClass( true );
143 // Add attribute: _value
144 {
145 daeMetaAttribute *ma = new daeMetaAttribute;
146 ma->setName( "_value" );
147 ma->setType( dae.getAtomicTypes().get("Fx_modifier_enum_common"));
148 ma->setOffset( daeOffsetOf( domGles_newparam::domModifier , _value ));
149 ma->setContainer( meta );
150 meta->appendAttribute(ma);
151 }
152
153 meta->setElementSize(sizeof(domGles_newparam::domModifier));
154 meta->validate();
155
156 return meta;
157 }
158
159