Home | History | Annotate | Download | only in dom
      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/domVisual_scene.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
     20 domVisual_scene::create(DAE& dae)
     21 {
     22 	domVisual_sceneRef ref = new domVisual_scene(dae);
     23 	return ref;
     24 }
     25 
     26 
     27 daeMetaElement *
     28 domVisual_scene::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( "visual_scene" );
     36 	meta->registerClass(domVisual_scene::create);
     37 
     38 	daeMetaCMPolicy *cm = NULL;
     39 	daeMetaElementAttribute *mea = NULL;
     40 	cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
     41 
     42 	mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
     43 	mea->setName( "asset" );
     44 	mea->setOffset( daeOffsetOf(domVisual_scene,elemAsset) );
     45 	mea->setElementType( domAsset::registerElement(dae) );
     46 	cm->appendChild( mea );
     47 
     48 	mea = new daeMetaElementArrayAttribute( meta, cm, 1, 1, -1 );
     49 	mea->setName( "node" );
     50 	mea->setOffset( daeOffsetOf(domVisual_scene,elemNode_array) );
     51 	mea->setElementType( domNode::registerElement(dae) );
     52 	cm->appendChild( mea );
     53 
     54 	mea = new daeMetaElementArrayAttribute( meta, cm, 2, 0, -1 );
     55 	mea->setName( "evaluate_scene" );
     56 	mea->setOffset( daeOffsetOf(domVisual_scene,elemEvaluate_scene_array) );
     57 	mea->setElementType( domVisual_scene::domEvaluate_scene::registerElement(dae) );
     58 	cm->appendChild( mea );
     59 
     60 	mea = new daeMetaElementArrayAttribute( meta, cm, 3, 0, -1 );
     61 	mea->setName( "extra" );
     62 	mea->setOffset( daeOffsetOf(domVisual_scene,elemExtra_array) );
     63 	mea->setElementType( domExtra::registerElement(dae) );
     64 	cm->appendChild( mea );
     65 
     66 	cm->setMaxOrdinal( 3 );
     67 	meta->setCMRoot( cm );
     68 
     69 	//	Add attribute: id
     70 	{
     71 		daeMetaAttribute *ma = new daeMetaAttribute;
     72 		ma->setName( "id" );
     73 		ma->setType( dae.getAtomicTypes().get("xsID"));
     74 		ma->setOffset( daeOffsetOf( domVisual_scene , attrId ));
     75 		ma->setContainer( meta );
     76 		ma->setIsRequired( false );
     77 
     78 		meta->appendAttribute(ma);
     79 	}
     80 
     81 	//	Add attribute: name
     82 	{
     83 		daeMetaAttribute *ma = new daeMetaAttribute;
     84 		ma->setName( "name" );
     85 		ma->setType( dae.getAtomicTypes().get("xsNCName"));
     86 		ma->setOffset( daeOffsetOf( domVisual_scene , attrName ));
     87 		ma->setContainer( meta );
     88 
     89 		meta->appendAttribute(ma);
     90 	}
     91 
     92 	meta->setElementSize(sizeof(domVisual_scene));
     93 	meta->validate();
     94 
     95 	return meta;
     96 }
     97 
     98 daeElementRef
     99 domVisual_scene::domEvaluate_scene::create(DAE& dae)
    100 {
    101 	domVisual_scene::domEvaluate_sceneRef ref = new domVisual_scene::domEvaluate_scene(dae);
    102 	return ref;
    103 }
    104 
    105 
    106 daeMetaElement *
    107 domVisual_scene::domEvaluate_scene::registerElement(DAE& dae)
    108 {
    109 	daeMetaElement* meta = dae.getMeta(ID());
    110 	if ( meta != NULL ) return meta;
    111 
    112 	meta = new daeMetaElement(dae);
    113 	dae.setMeta(ID(), *meta);
    114 	meta->setName( "evaluate_scene" );
    115 	meta->registerClass(domVisual_scene::domEvaluate_scene::create);
    116 
    117 	meta->setIsInnerClass( true );
    118 	daeMetaCMPolicy *cm = NULL;
    119 	daeMetaElementAttribute *mea = NULL;
    120 	cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
    121 
    122 	mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, -1 );
    123 	mea->setName( "render" );
    124 	mea->setOffset( daeOffsetOf(domVisual_scene::domEvaluate_scene,elemRender_array) );
    125 	mea->setElementType( domVisual_scene::domEvaluate_scene::domRender::registerElement(dae) );
    126 	cm->appendChild( mea );
    127 
    128 	cm->setMaxOrdinal( 0 );
    129 	meta->setCMRoot( cm );
    130 
    131 	//	Add attribute: name
    132 	{
    133 		daeMetaAttribute *ma = new daeMetaAttribute;
    134 		ma->setName( "name" );
    135 		ma->setType( dae.getAtomicTypes().get("xsNCName"));
    136 		ma->setOffset( daeOffsetOf( domVisual_scene::domEvaluate_scene , attrName ));
    137 		ma->setContainer( meta );
    138 
    139 		meta->appendAttribute(ma);
    140 	}
    141 
    142 	meta->setElementSize(sizeof(domVisual_scene::domEvaluate_scene));
    143 	meta->validate();
    144 
    145 	return meta;
    146 }
    147 
    148 daeElementRef
    149 domVisual_scene::domEvaluate_scene::domRender::create(DAE& dae)
    150 {
    151 	domVisual_scene::domEvaluate_scene::domRenderRef ref = new domVisual_scene::domEvaluate_scene::domRender(dae);
    152 	return ref;
    153 }
    154 
    155 
    156 daeMetaElement *
    157 domVisual_scene::domEvaluate_scene::domRender::registerElement(DAE& dae)
    158 {
    159 	daeMetaElement* meta = dae.getMeta(ID());
    160 	if ( meta != NULL ) return meta;
    161 
    162 	meta = new daeMetaElement(dae);
    163 	dae.setMeta(ID(), *meta);
    164 	meta->setName( "render" );
    165 	meta->registerClass(domVisual_scene::domEvaluate_scene::domRender::create);
    166 
    167 	meta->setIsInnerClass( true );
    168 	daeMetaCMPolicy *cm = NULL;
    169 	daeMetaElementAttribute *mea = NULL;
    170 	cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
    171 
    172 	mea = new daeMetaElementArrayAttribute( meta, cm, 0, 0, -1 );
    173 	mea->setName( "layer" );
    174 	mea->setOffset( daeOffsetOf(domVisual_scene::domEvaluate_scene::domRender,elemLayer_array) );
    175 	mea->setElementType( domVisual_scene::domEvaluate_scene::domRender::domLayer::registerElement(dae) );
    176 	cm->appendChild( mea );
    177 
    178 	mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
    179 	mea->setName( "instance_effect" );
    180 	mea->setOffset( daeOffsetOf(domVisual_scene::domEvaluate_scene::domRender,elemInstance_effect) );
    181 	mea->setElementType( domInstance_effect::registerElement(dae) );
    182 	cm->appendChild( mea );
    183 
    184 	cm->setMaxOrdinal( 1 );
    185 	meta->setCMRoot( cm );
    186 
    187 	//	Add attribute: camera_node
    188 	{
    189 		daeMetaAttribute *ma = new daeMetaAttribute;
    190 		ma->setName( "camera_node" );
    191 		ma->setType( dae.getAtomicTypes().get("xsAnyURI"));
    192 		ma->setOffset( daeOffsetOf( domVisual_scene::domEvaluate_scene::domRender , attrCamera_node ));
    193 		ma->setContainer( meta );
    194 		ma->setIsRequired( true );
    195 
    196 		meta->appendAttribute(ma);
    197 	}
    198 
    199 	meta->setElementSize(sizeof(domVisual_scene::domEvaluate_scene::domRender));
    200 	meta->validate();
    201 
    202 	return meta;
    203 }
    204 
    205 daeElementRef
    206 domVisual_scene::domEvaluate_scene::domRender::domLayer::create(DAE& dae)
    207 {
    208 	domVisual_scene::domEvaluate_scene::domRender::domLayerRef ref = new domVisual_scene::domEvaluate_scene::domRender::domLayer(dae);
    209 	return ref;
    210 }
    211 
    212 
    213 daeMetaElement *
    214 domVisual_scene::domEvaluate_scene::domRender::domLayer::registerElement(DAE& dae)
    215 {
    216 	daeMetaElement* meta = dae.getMeta(ID());
    217 	if ( meta != NULL ) return meta;
    218 
    219 	meta = new daeMetaElement(dae);
    220 	dae.setMeta(ID(), *meta);
    221 	meta->setName( "layer" );
    222 	meta->registerClass(domVisual_scene::domEvaluate_scene::domRender::domLayer::create);
    223 
    224 	meta->setIsInnerClass( true );
    225 	//	Add attribute: _value
    226 	{
    227 		daeMetaAttribute *ma = new daeMetaAttribute;
    228 		ma->setName( "_value" );
    229 		ma->setType( dae.getAtomicTypes().get("xsNCName"));
    230 		ma->setOffset( daeOffsetOf( domVisual_scene::domEvaluate_scene::domRender::domLayer , _value ));
    231 		ma->setContainer( meta );
    232 		meta->appendAttribute(ma);
    233 	}
    234 
    235 	meta->setElementSize(sizeof(domVisual_scene::domEvaluate_scene::domRender::domLayer));
    236 	meta->validate();
    237 
    238 	return meta;
    239 }
    240 
    241