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/domGl_sampler3D.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
19daeElementRef
20domGl_sampler3D::create(DAE& dae)
21{
22	domGl_sampler3DRef ref = new domGl_sampler3D(dae);
23	return ref;
24}
25
26
27daeMetaElement *
28domGl_sampler3D::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( "gl_sampler3D" );
36	meta->registerClass(domGl_sampler3D::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(domGl_sampler3D,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(domGl_sampler3D,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(domGl_sampler3D,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( "wrap_p" );
64	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemWrap_p) );
65	mea->setElementType( domWrap_p::registerElement(dae) );
66	cm->appendChild( mea );
67
68	mea = new daeMetaElementAttribute( meta, cm, 4, 0, 1 );
69	mea->setName( "minfilter" );
70	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemMinfilter) );
71	mea->setElementType( domMinfilter::registerElement(dae) );
72	cm->appendChild( mea );
73
74	mea = new daeMetaElementAttribute( meta, cm, 5, 0, 1 );
75	mea->setName( "magfilter" );
76	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemMagfilter) );
77	mea->setElementType( domMagfilter::registerElement(dae) );
78	cm->appendChild( mea );
79
80	mea = new daeMetaElementAttribute( meta, cm, 6, 0, 1 );
81	mea->setName( "mipfilter" );
82	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemMipfilter) );
83	mea->setElementType( domMipfilter::registerElement(dae) );
84	cm->appendChild( mea );
85
86	mea = new daeMetaElementAttribute( meta, cm, 7, 0, 1 );
87	mea->setName( "border_color" );
88	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemBorder_color) );
89	mea->setElementType( domBorder_color::registerElement(dae) );
90	cm->appendChild( mea );
91
92	mea = new daeMetaElementAttribute( meta, cm, 8, 0, 1 );
93	mea->setName( "mipmap_maxlevel" );
94	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemMipmap_maxlevel) );
95	mea->setElementType( domMipmap_maxlevel::registerElement(dae) );
96	cm->appendChild( mea );
97
98	mea = new daeMetaElementAttribute( meta, cm, 9, 0, 1 );
99	mea->setName( "mipmap_bias" );
100	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemMipmap_bias) );
101	mea->setElementType( domMipmap_bias::registerElement(dae) );
102	cm->appendChild( mea );
103
104	mea = new daeMetaElementArrayAttribute( meta, cm, 10, 0, -1 );
105	mea->setName( "extra" );
106	mea->setOffset( daeOffsetOf(domGl_sampler3D,elemExtra_array) );
107	mea->setElementType( domExtra::registerElement(dae) );
108	cm->appendChild( mea );
109
110	cm->setMaxOrdinal( 10 );
111	cm->getParent()->appendChild( cm );
112	cm = cm->getParent();
113
114	cm->setMaxOrdinal( 10 );
115	meta->setCMRoot( cm );
116
117	meta->setElementSize(sizeof(domGl_sampler3D));
118	meta->validate();
119
120	return meta;
121}
122
123