domInputLocalOffset.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #include <dae.h>
  14. #include <dae/daeDom.h>
  15. #include <dom/domInputLocalOffset.h>
  16. #include <dae/daeMetaCMPolicy.h>
  17. #include <dae/daeMetaSequence.h>
  18. #include <dae/daeMetaChoice.h>
  19. #include <dae/daeMetaGroup.h>
  20. #include <dae/daeMetaAny.h>
  21. #include <dae/daeMetaElementAttribute.h>
  22. daeElementRef
  23. domInputLocalOffset::create(DAE& dae)
  24. {
  25. domInputLocalOffsetRef ref = new domInputLocalOffset(dae);
  26. return ref;
  27. }
  28. daeMetaElement *
  29. domInputLocalOffset::registerElement(DAE& dae)
  30. {
  31. daeMetaElement* meta = dae.getMeta(ID());
  32. if ( meta != NULL ) return meta;
  33. meta = new daeMetaElement(dae);
  34. dae.setMeta(ID(), *meta);
  35. meta->setName( "InputLocalOffset" );
  36. meta->registerClass(domInputLocalOffset::create);
  37. // Add attribute: offset
  38. {
  39. daeMetaAttribute *ma = new daeMetaAttribute;
  40. ma->setName( "offset" );
  41. ma->setType( dae.getAtomicTypes().get("Uint"));
  42. ma->setOffset( daeOffsetOf( domInputLocalOffset , attrOffset ));
  43. ma->setContainer( meta );
  44. ma->setIsRequired( true );
  45. meta->appendAttribute(ma);
  46. }
  47. // Add attribute: semantic
  48. {
  49. daeMetaAttribute *ma = new daeMetaAttribute;
  50. ma->setName( "semantic" );
  51. ma->setType( dae.getAtomicTypes().get("xsNMTOKEN"));
  52. ma->setOffset( daeOffsetOf( domInputLocalOffset , attrSemantic ));
  53. ma->setContainer( meta );
  54. ma->setIsRequired( true );
  55. meta->appendAttribute(ma);
  56. }
  57. // Add attribute: source
  58. {
  59. daeMetaAttribute *ma = new daeMetaAttribute;
  60. ma->setName( "source" );
  61. ma->setType( dae.getAtomicTypes().get("URIFragmentType"));
  62. ma->setOffset( daeOffsetOf( domInputLocalOffset , attrSource ));
  63. ma->setContainer( meta );
  64. ma->setIsRequired( true );
  65. meta->appendAttribute(ma);
  66. }
  67. // Add attribute: set
  68. {
  69. daeMetaAttribute *ma = new daeMetaAttribute;
  70. ma->setName( "set" );
  71. ma->setType( dae.getAtomicTypes().get("Uint"));
  72. ma->setOffset( daeOffsetOf( domInputLocalOffset , attrSet ));
  73. ma->setContainer( meta );
  74. meta->appendAttribute(ma);
  75. }
  76. meta->setElementSize(sizeof(domInputLocalOffset));
  77. meta->validate();
  78. return meta;
  79. }