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 <1.4/dom/domInt_array.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 
20 namespace ColladaDOM141 {
21 daeElementRef
create(DAE & dae)22 domInt_array::create(DAE& dae)
23 {
24 	domInt_arrayRef ref = new domInt_array(dae);
25 	return ref;
26 }
27 
28 
29 daeMetaElement *
registerElement(DAE & dae)30 domInt_array::registerElement(DAE& dae)
31 {
32 	daeMetaElement* meta = dae.getMeta(ID());
33 	if ( meta != NULL ) return meta;
34 
35 	meta = new daeMetaElement(dae);
36 	dae.setMeta(ID(), *meta);
37 	meta->setName( "int_array" );
38 	meta->registerClass(domInt_array::create);
39 
40 	//	Add attribute: _value
41 	{
42 		daeMetaAttribute *ma = new daeMetaArrayAttribute;
43 		ma->setName( "_value" );
44 		ma->setType( dae.getAtomicTypes().get("ListOfInts"));
45 		ma->setOffset( daeOffsetOf( domInt_array , _value ));
46 		ma->setContainer( meta );
47 		meta->appendAttribute(ma);
48 	}
49 
50 	//	Add attribute: id
51 	{
52 		daeMetaAttribute *ma = new daeMetaAttribute;
53 		ma->setName( "id" );
54 		ma->setType( dae.getAtomicTypes().get("xsID"));
55 		ma->setOffset( daeOffsetOf( domInt_array , attrId ));
56 		ma->setContainer( meta );
57 
58 		meta->appendAttribute(ma);
59 	}
60 
61 	//	Add attribute: name
62 	{
63 		daeMetaAttribute *ma = new daeMetaAttribute;
64 		ma->setName( "name" );
65 		ma->setType( dae.getAtomicTypes().get("xsNCName"));
66 		ma->setOffset( daeOffsetOf( domInt_array , attrName ));
67 		ma->setContainer( meta );
68 
69 		meta->appendAttribute(ma);
70 	}
71 
72 	//	Add attribute: count
73 	{
74 		daeMetaAttribute *ma = new daeMetaAttribute;
75 		ma->setName( "count" );
76 		ma->setType( dae.getAtomicTypes().get("Uint"));
77 		ma->setOffset( daeOffsetOf( domInt_array , attrCount ));
78 		ma->setContainer( meta );
79 		ma->setIsRequired( true );
80 
81 		meta->appendAttribute(ma);
82 	}
83 
84 	//	Add attribute: minInclusive
85 	{
86 		daeMetaAttribute *ma = new daeMetaAttribute;
87 		ma->setName( "minInclusive" );
88 		ma->setType( dae.getAtomicTypes().get("xsInteger"));
89 		ma->setOffset( daeOffsetOf( domInt_array , attrMinInclusive ));
90 		ma->setContainer( meta );
91 		ma->setDefaultString( "-2147483648");
92 
93 		meta->appendAttribute(ma);
94 	}
95 
96 	//	Add attribute: maxInclusive
97 	{
98 		daeMetaAttribute *ma = new daeMetaAttribute;
99 		ma->setName( "maxInclusive" );
100 		ma->setType( dae.getAtomicTypes().get("xsInteger"));
101 		ma->setOffset( daeOffsetOf( domInt_array , attrMaxInclusive ));
102 		ma->setContainer( meta );
103 		ma->setDefaultString( "2147483647");
104 
105 		meta->appendAttribute(ma);
106 	}
107 
108 	meta->setElementSize(sizeof(domInt_array));
109 	meta->validate();
110 
111 	return meta;
112 }
113 
114 } // ColladaDOM141
115