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/domBind_material.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 domBind_material::create(DAE& dae)
21 {
22 domBind_materialRef ref = new domBind_material(dae);
23 return ref;
24 }
25
26
27 daeMetaElement *
registerElement(DAE & dae)28 domBind_material::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( "bind_material" );
36 meta->registerClass(domBind_material::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( "param" );
44 mea->setOffset( daeOffsetOf(domBind_material,elemParam_array) );
45 mea->setElementType( domParam::registerElement(dae) );
46 cm->appendChild( mea );
47
48 mea = new daeMetaElementAttribute( meta, cm, 1, 1, 1 );
49 mea->setName( "technique_common" );
50 mea->setOffset( daeOffsetOf(domBind_material,elemTechnique_common) );
51 mea->setElementType( domBind_material::domTechnique_common::registerElement(dae) );
52 cm->appendChild( mea );
53
54 mea = new daeMetaElementArrayAttribute( meta, cm, 2, 0, -1 );
55 mea->setName( "technique" );
56 mea->setOffset( daeOffsetOf(domBind_material,elemTechnique_array) );
57 mea->setElementType( domTechnique::registerElement(dae) );
58 cm->appendChild( mea );
59
60 mea = new daeMetaElementArrayAttribute( meta, cm, 3, 0, -1 );
61 mea->setName( "extra" );
62 mea->setOffset( daeOffsetOf(domBind_material,elemExtra_array) );
63 mea->setElementType( domExtra::registerElement(dae) );
64 cm->appendChild( mea );
65
66 cm->setMaxOrdinal( 3 );
67 meta->setCMRoot( cm );
68
69 meta->setElementSize(sizeof(domBind_material));
70 meta->validate();
71
72 return meta;
73 }
74
75 daeElementRef
create(DAE & dae)76 domBind_material::domTechnique_common::create(DAE& dae)
77 {
78 domBind_material::domTechnique_commonRef ref = new domBind_material::domTechnique_common(dae);
79 return ref;
80 }
81
82
83 daeMetaElement *
registerElement(DAE & dae)84 domBind_material::domTechnique_common::registerElement(DAE& dae)
85 {
86 daeMetaElement* meta = dae.getMeta(ID());
87 if ( meta != NULL ) return meta;
88
89 meta = new daeMetaElement(dae);
90 dae.setMeta(ID(), *meta);
91 meta->setName( "technique_common" );
92 meta->registerClass(domBind_material::domTechnique_common::create);
93
94 meta->setIsInnerClass( true );
95 daeMetaCMPolicy *cm = NULL;
96 daeMetaElementAttribute *mea = NULL;
97 cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
98
99 mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, -1 );
100 mea->setName( "instance_material" );
101 mea->setOffset( daeOffsetOf(domBind_material::domTechnique_common,elemInstance_material_array) );
102 mea->setElementType( domInstance_material::registerElement(dae) );
103 cm->appendChild( mea );
104
105 cm->setMaxOrdinal( 0 );
106 meta->setCMRoot( cm );
107
108 meta->setElementSize(sizeof(domBind_material::domTechnique_common));
109 meta->validate();
110
111 return meta;
112 }
113
114