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/domFloat_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
19daeElementRef
20domFloat_array::create(DAE& dae)
21{
22	domFloat_arrayRef ref = new domFloat_array(dae);
23	return ref;
24}
25
26
27daeMetaElement *
28domFloat_array::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( "float_array" );
36	meta->registerClass(domFloat_array::create);
37
38	//	Add attribute: _value
39	{
40		daeMetaAttribute *ma = new daeMetaArrayAttribute;
41		ma->setName( "_value" );
42		ma->setType( dae.getAtomicTypes().get("ListOfFloats"));
43		ma->setOffset( daeOffsetOf( domFloat_array , _value ));
44		ma->setContainer( meta );
45		meta->appendAttribute(ma);
46	}
47
48	//	Add attribute: id
49	{
50		daeMetaAttribute *ma = new daeMetaAttribute;
51		ma->setName( "id" );
52		ma->setType( dae.getAtomicTypes().get("xsID"));
53		ma->setOffset( daeOffsetOf( domFloat_array , attrId ));
54		ma->setContainer( meta );
55
56		meta->appendAttribute(ma);
57	}
58
59	//	Add attribute: name
60	{
61		daeMetaAttribute *ma = new daeMetaAttribute;
62		ma->setName( "name" );
63		ma->setType( dae.getAtomicTypes().get("xsNCName"));
64		ma->setOffset( daeOffsetOf( domFloat_array , attrName ));
65		ma->setContainer( meta );
66
67		meta->appendAttribute(ma);
68	}
69
70	//	Add attribute: count
71	{
72		daeMetaAttribute *ma = new daeMetaAttribute;
73		ma->setName( "count" );
74		ma->setType( dae.getAtomicTypes().get("Uint"));
75		ma->setOffset( daeOffsetOf( domFloat_array , attrCount ));
76		ma->setContainer( meta );
77		ma->setIsRequired( true );
78
79		meta->appendAttribute(ma);
80	}
81
82	//	Add attribute: digits
83	{
84		daeMetaAttribute *ma = new daeMetaAttribute;
85		ma->setName( "digits" );
86		ma->setType( dae.getAtomicTypes().get("xsShort"));
87		ma->setOffset( daeOffsetOf( domFloat_array , attrDigits ));
88		ma->setContainer( meta );
89		ma->setDefaultString( "6");
90
91		meta->appendAttribute(ma);
92	}
93
94	//	Add attribute: magnitude
95	{
96		daeMetaAttribute *ma = new daeMetaAttribute;
97		ma->setName( "magnitude" );
98		ma->setType( dae.getAtomicTypes().get("xsShort"));
99		ma->setOffset( daeOffsetOf( domFloat_array , attrMagnitude ));
100		ma->setContainer( meta );
101		ma->setDefaultString( "38");
102
103		meta->appendAttribute(ma);
104	}
105
106	meta->setElementSize(sizeof(domFloat_array));
107	meta->validate();
108
109	return meta;
110}
111
112