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 #ifndef __DAE_META_CHOICE_H__ 10 #define __DAE_META_CHOICE_H__ 11 12 #include <dae/daeMetaCMPolicy.h> 13 14 /** 15 * The daeMetaChoice class defines the behavior of an xs:choice content model in the COLLADA Schema. 16 */ 17 class daeMetaChoice : public daeMetaCMPolicy 18 { 19 public: 20 /** 21 * Constructor. 22 * @param container The daeMetaElement that this policy object belongs to. 23 * @param parent The daeMetaCMPolicy parent of this policy object. 24 * @param choiceNum An unsigned integer that represents which index in an element's CMData array coresponds to this choice's data. 25 * @param odinal The ordinal value offset of this specific policy object. Used for maintaining the 26 * correct order of child elements. 27 * @param minO The minimum number of times this CMPolicy object must appear. This value comes from the COLLADA schema. 28 * @param maxO The maximum number of times this CMPolicy object may appear. This value comes from the COLLADA schema. 29 */ 30 daeMetaChoice( daeMetaElement *container, daeMetaCMPolicy *parent = NULL, daeUInt choiceNum = 0, daeUInt ordinal = 0, daeInt minO = 1, daeInt maxO = 1 ); 31 ~daeMetaChoice(); 32 33 daeElement *placeElement( daeElement *parent, daeElement *child, daeUInt &ordinal, daeInt offset = 0, daeElement* before = NULL, daeElement *after = NULL ); 34 daeBool removeElement(daeElement* parent, daeElement* child); 35 daeMetaElement *findChild( daeString elementName ); 36 void getChildren( daeElement* parent, daeElementRefArray &array ); 37 38 private: 39 daeUInt _choiceNum; 40 }; 41 42 #endif 43 44