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_sampler_state.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_sampler_state::create(DAE& dae)
21 {
22 domGles_sampler_stateRef ref = new domGles_sampler_state(dae);
23 return ref;
24 }
25
26
27 daeMetaElement *
registerElement(DAE & dae)28 domGles_sampler_state::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_sampler_state" );
36 meta->registerClass(domGles_sampler_state::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( "wrap_s" );
44 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemWrap_s) );
45 mea->setElementType( domGles_sampler_state::domWrap_s::registerElement(dae) );
46 cm->appendChild( mea );
47
48 mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
49 mea->setName( "wrap_t" );
50 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemWrap_t) );
51 mea->setElementType( domGles_sampler_state::domWrap_t::registerElement(dae) );
52 cm->appendChild( mea );
53
54 mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 );
55 mea->setName( "minfilter" );
56 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMinfilter) );
57 mea->setElementType( domGles_sampler_state::domMinfilter::registerElement(dae) );
58 cm->appendChild( mea );
59
60 mea = new daeMetaElementAttribute( meta, cm, 3, 0, 1 );
61 mea->setName( "magfilter" );
62 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMagfilter) );
63 mea->setElementType( domGles_sampler_state::domMagfilter::registerElement(dae) );
64 cm->appendChild( mea );
65
66 mea = new daeMetaElementAttribute( meta, cm, 4, 0, 1 );
67 mea->setName( "mipfilter" );
68 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMipfilter) );
69 mea->setElementType( domGles_sampler_state::domMipfilter::registerElement(dae) );
70 cm->appendChild( mea );
71
72 mea = new daeMetaElementAttribute( meta, cm, 5, 0, 1 );
73 mea->setName( "mipmap_maxlevel" );
74 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMipmap_maxlevel) );
75 mea->setElementType( domGles_sampler_state::domMipmap_maxlevel::registerElement(dae) );
76 cm->appendChild( mea );
77
78 mea = new daeMetaElementAttribute( meta, cm, 6, 0, 1 );
79 mea->setName( "mipmap_bias" );
80 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemMipmap_bias) );
81 mea->setElementType( domGles_sampler_state::domMipmap_bias::registerElement(dae) );
82 cm->appendChild( mea );
83
84 mea = new daeMetaElementArrayAttribute( meta, cm, 7, 0, -1 );
85 mea->setName( "extra" );
86 mea->setOffset( daeOffsetOf(domGles_sampler_state,elemExtra_array) );
87 mea->setElementType( domExtra::registerElement(dae) );
88 cm->appendChild( mea );
89
90 cm->setMaxOrdinal( 7 );
91 meta->setCMRoot( cm );
92
93 // Add attribute: sid
94 {
95 daeMetaAttribute *ma = new daeMetaAttribute;
96 ma->setName( "sid" );
97 ma->setType( dae.getAtomicTypes().get("xsNCName"));
98 ma->setOffset( daeOffsetOf( domGles_sampler_state , attrSid ));
99 ma->setContainer( meta );
100
101 meta->appendAttribute(ma);
102 }
103
104 meta->setElementSize(sizeof(domGles_sampler_state));
105 meta->validate();
106
107 return meta;
108 }
109
110 daeElementRef
create(DAE & dae)111 domGles_sampler_state::domWrap_s::create(DAE& dae)
112 {
113 domGles_sampler_state::domWrap_sRef ref = new domGles_sampler_state::domWrap_s(dae);
114 return ref;
115 }
116
117
118 daeMetaElement *
registerElement(DAE & dae)119 domGles_sampler_state::domWrap_s::registerElement(DAE& dae)
120 {
121 daeMetaElement* meta = dae.getMeta(ID());
122 if ( meta != NULL ) return meta;
123
124 meta = new daeMetaElement(dae);
125 dae.setMeta(ID(), *meta);
126 meta->setName( "wrap_s" );
127 meta->registerClass(domGles_sampler_state::domWrap_s::create);
128
129 meta->setIsInnerClass( true );
130 // Add attribute: _value
131 {
132 daeMetaAttribute *ma = new daeMetaAttribute;
133 ma->setName( "_value" );
134 ma->setType( dae.getAtomicTypes().get("Gles_sampler_wrap"));
135 ma->setOffset( daeOffsetOf( domGles_sampler_state::domWrap_s , _value ));
136 ma->setContainer( meta );
137 meta->appendAttribute(ma);
138 }
139
140 meta->setElementSize(sizeof(domGles_sampler_state::domWrap_s));
141 meta->validate();
142
143 return meta;
144 }
145
146 daeElementRef
create(DAE & dae)147 domGles_sampler_state::domWrap_t::create(DAE& dae)
148 {
149 domGles_sampler_state::domWrap_tRef ref = new domGles_sampler_state::domWrap_t(dae);
150 return ref;
151 }
152
153
154 daeMetaElement *
registerElement(DAE & dae)155 domGles_sampler_state::domWrap_t::registerElement(DAE& dae)
156 {
157 daeMetaElement* meta = dae.getMeta(ID());
158 if ( meta != NULL ) return meta;
159
160 meta = new daeMetaElement(dae);
161 dae.setMeta(ID(), *meta);
162 meta->setName( "wrap_t" );
163 meta->registerClass(domGles_sampler_state::domWrap_t::create);
164
165 meta->setIsInnerClass( true );
166 // Add attribute: _value
167 {
168 daeMetaAttribute *ma = new daeMetaAttribute;
169 ma->setName( "_value" );
170 ma->setType( dae.getAtomicTypes().get("Gles_sampler_wrap"));
171 ma->setOffset( daeOffsetOf( domGles_sampler_state::domWrap_t , _value ));
172 ma->setContainer( meta );
173 meta->appendAttribute(ma);
174 }
175
176 meta->setElementSize(sizeof(domGles_sampler_state::domWrap_t));
177 meta->validate();
178
179 return meta;
180 }
181
182 daeElementRef
create(DAE & dae)183 domGles_sampler_state::domMinfilter::create(DAE& dae)
184 {
185 domGles_sampler_state::domMinfilterRef ref = new domGles_sampler_state::domMinfilter(dae);
186 return ref;
187 }
188
189
190 daeMetaElement *
registerElement(DAE & dae)191 domGles_sampler_state::domMinfilter::registerElement(DAE& dae)
192 {
193 daeMetaElement* meta = dae.getMeta(ID());
194 if ( meta != NULL ) return meta;
195
196 meta = new daeMetaElement(dae);
197 dae.setMeta(ID(), *meta);
198 meta->setName( "minfilter" );
199 meta->registerClass(domGles_sampler_state::domMinfilter::create);
200
201 meta->setIsInnerClass( true );
202 // Add attribute: _value
203 {
204 daeMetaAttribute *ma = new daeMetaAttribute;
205 ma->setName( "_value" );
206 ma->setType( dae.getAtomicTypes().get("Fx_sampler_filter_common"));
207 ma->setOffset( daeOffsetOf( domGles_sampler_state::domMinfilter , _value ));
208 ma->setContainer( meta );
209 meta->appendAttribute(ma);
210 }
211
212 meta->setElementSize(sizeof(domGles_sampler_state::domMinfilter));
213 meta->validate();
214
215 return meta;
216 }
217
218 daeElementRef
create(DAE & dae)219 domGles_sampler_state::domMagfilter::create(DAE& dae)
220 {
221 domGles_sampler_state::domMagfilterRef ref = new domGles_sampler_state::domMagfilter(dae);
222 return ref;
223 }
224
225
226 daeMetaElement *
registerElement(DAE & dae)227 domGles_sampler_state::domMagfilter::registerElement(DAE& dae)
228 {
229 daeMetaElement* meta = dae.getMeta(ID());
230 if ( meta != NULL ) return meta;
231
232 meta = new daeMetaElement(dae);
233 dae.setMeta(ID(), *meta);
234 meta->setName( "magfilter" );
235 meta->registerClass(domGles_sampler_state::domMagfilter::create);
236
237 meta->setIsInnerClass( true );
238 // Add attribute: _value
239 {
240 daeMetaAttribute *ma = new daeMetaAttribute;
241 ma->setName( "_value" );
242 ma->setType( dae.getAtomicTypes().get("Fx_sampler_filter_common"));
243 ma->setOffset( daeOffsetOf( domGles_sampler_state::domMagfilter , _value ));
244 ma->setContainer( meta );
245 meta->appendAttribute(ma);
246 }
247
248 meta->setElementSize(sizeof(domGles_sampler_state::domMagfilter));
249 meta->validate();
250
251 return meta;
252 }
253
254 daeElementRef
create(DAE & dae)255 domGles_sampler_state::domMipfilter::create(DAE& dae)
256 {
257 domGles_sampler_state::domMipfilterRef ref = new domGles_sampler_state::domMipfilter(dae);
258 return ref;
259 }
260
261
262 daeMetaElement *
registerElement(DAE & dae)263 domGles_sampler_state::domMipfilter::registerElement(DAE& dae)
264 {
265 daeMetaElement* meta = dae.getMeta(ID());
266 if ( meta != NULL ) return meta;
267
268 meta = new daeMetaElement(dae);
269 dae.setMeta(ID(), *meta);
270 meta->setName( "mipfilter" );
271 meta->registerClass(domGles_sampler_state::domMipfilter::create);
272
273 meta->setIsInnerClass( true );
274 // Add attribute: _value
275 {
276 daeMetaAttribute *ma = new daeMetaAttribute;
277 ma->setName( "_value" );
278 ma->setType( dae.getAtomicTypes().get("Fx_sampler_filter_common"));
279 ma->setOffset( daeOffsetOf( domGles_sampler_state::domMipfilter , _value ));
280 ma->setContainer( meta );
281 meta->appendAttribute(ma);
282 }
283
284 meta->setElementSize(sizeof(domGles_sampler_state::domMipfilter));
285 meta->validate();
286
287 return meta;
288 }
289
290 daeElementRef
create(DAE & dae)291 domGles_sampler_state::domMipmap_maxlevel::create(DAE& dae)
292 {
293 domGles_sampler_state::domMipmap_maxlevelRef ref = new domGles_sampler_state::domMipmap_maxlevel(dae);
294 return ref;
295 }
296
297
298 daeMetaElement *
registerElement(DAE & dae)299 domGles_sampler_state::domMipmap_maxlevel::registerElement(DAE& dae)
300 {
301 daeMetaElement* meta = dae.getMeta(ID());
302 if ( meta != NULL ) return meta;
303
304 meta = new daeMetaElement(dae);
305 dae.setMeta(ID(), *meta);
306 meta->setName( "mipmap_maxlevel" );
307 meta->registerClass(domGles_sampler_state::domMipmap_maxlevel::create);
308
309 meta->setIsInnerClass( true );
310 // Add attribute: _value
311 {
312 daeMetaAttribute *ma = new daeMetaAttribute;
313 ma->setName( "_value" );
314 ma->setType( dae.getAtomicTypes().get("xsUnsignedByte"));
315 ma->setOffset( daeOffsetOf( domGles_sampler_state::domMipmap_maxlevel , _value ));
316 ma->setContainer( meta );
317 meta->appendAttribute(ma);
318 }
319
320 meta->setElementSize(sizeof(domGles_sampler_state::domMipmap_maxlevel));
321 meta->validate();
322
323 return meta;
324 }
325
326 daeElementRef
create(DAE & dae)327 domGles_sampler_state::domMipmap_bias::create(DAE& dae)
328 {
329 domGles_sampler_state::domMipmap_biasRef ref = new domGles_sampler_state::domMipmap_bias(dae);
330 return ref;
331 }
332
333
334 daeMetaElement *
registerElement(DAE & dae)335 domGles_sampler_state::domMipmap_bias::registerElement(DAE& dae)
336 {
337 daeMetaElement* meta = dae.getMeta(ID());
338 if ( meta != NULL ) return meta;
339
340 meta = new daeMetaElement(dae);
341 dae.setMeta(ID(), *meta);
342 meta->setName( "mipmap_bias" );
343 meta->registerClass(domGles_sampler_state::domMipmap_bias::create);
344
345 meta->setIsInnerClass( true );
346 // Add attribute: _value
347 {
348 daeMetaAttribute *ma = new daeMetaAttribute;
349 ma->setName( "_value" );
350 ma->setType( dae.getAtomicTypes().get("xsFloat"));
351 ma->setOffset( daeOffsetOf( domGles_sampler_state::domMipmap_bias , _value ));
352 ma->setContainer( meta );
353 meta->appendAttribute(ma);
354 }
355
356 meta->setElementSize(sizeof(domGles_sampler_state::domMipmap_bias));
357 meta->validate();
358
359 return meta;
360 }
361
362