blob: 33737c7c26fbffbf0ef4407ee0f1b666b5cb06c3 [file] [log] [blame]
/*
* Copyright 2006 Sony Computer Entertainment Inc.
*
* Licensed under the MIT Open Source License, for details please see license.txt or the website
* http://www.opensource.org/licenses/mit-license.php
*
*/
#include <dae.h>
#include <dae/daeDom.h>
#include <dom/domLibrary_animations.h>
#include <dae/daeMetaCMPolicy.h>
#include <dae/daeMetaSequence.h>
#include <dae/daeMetaChoice.h>
#include <dae/daeMetaGroup.h>
#include <dae/daeMetaAny.h>
#include <dae/daeMetaElementAttribute.h>
daeElementRef
domLibrary_animations::create(DAE& dae)
{
domLibrary_animationsRef ref = new domLibrary_animations(dae);
return ref;
}
daeMetaElement *
domLibrary_animations::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "library_animations" );
meta->registerClass(domLibrary_animations::create);
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "asset" );
mea->setOffset( daeOffsetOf(domLibrary_animations,elemAsset) );
mea->setElementType( domAsset::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( meta, cm, 1, 1, -1 );
mea->setName( "animation" );
mea->setOffset( daeOffsetOf(domLibrary_animations,elemAnimation_array) );
mea->setElementType( domAnimation::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( meta, cm, 2, 0, -1 );
mea->setName( "extra" );
mea->setOffset( daeOffsetOf(domLibrary_animations,elemExtra_array) );
mea->setElementType( domExtra::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 2 );
meta->setCMRoot( cm );
// Add attribute: id
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "id" );
ma->setType( dae.getAtomicTypes().get("xsID"));
ma->setOffset( daeOffsetOf( domLibrary_animations , attrId ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
// Add attribute: name
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "name" );
ma->setType( dae.getAtomicTypes().get("xsNCName"));
ma->setOffset( daeOffsetOf( domLibrary_animations , attrName ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
meta->setElementSize(sizeof(domLibrary_animations));
meta->validate();
return meta;
}