daeMetaChoice.h 1.7 KB

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