domTechnique.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. #ifndef __domTechnique_h__
  14. #define __domTechnique_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The technique element declares the information used to process some portion
  21. * of the content. Each technique conforms to an associated profile. Techniques
  22. * generally act as a “switch”. If more than one is present for a particular
  23. * portion of content, on import, one or the other is picked, but usually
  24. * not both. Selection should be based on which profile the importing application
  25. * can support. Techniques contain application data and programs, making them
  26. * assets that can be managed as a unit.
  27. */
  28. class domTechnique : public daeElement
  29. {
  30. public:
  31. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE; }
  32. static daeInt ID() { return 680; }
  33. virtual daeInt typeID() const { return ID(); }
  34. protected: // Attribute
  35. /**
  36. * This element may specify its own xmlns.
  37. */
  38. xsAnyURI attrXmlns;
  39. /**
  40. * The profile attribute indicates the type of profile. This is a vendor
  41. * defined character string that indicates the platform or capability target
  42. * for the technique. Required attribute.
  43. */
  44. xsNMTOKEN attrProfile;
  45. protected: // Element
  46. /**
  47. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  48. */
  49. daeElementRefArray _contents;
  50. /**
  51. * Used to preserve order in elements that have a complex content model.
  52. */
  53. daeUIntArray _contentsOrder;
  54. public: //Accessors and Mutators
  55. /**
  56. * Gets the xmlns attribute.
  57. * @return Returns a xsAnyURI reference of the xmlns attribute.
  58. */
  59. xsAnyURI &getXmlns() { return attrXmlns; }
  60. /**
  61. * Gets the xmlns attribute.
  62. * @return Returns a constant xsAnyURI reference of the xmlns attribute.
  63. */
  64. const xsAnyURI &getXmlns() const { return attrXmlns; }
  65. /**
  66. * Sets the xmlns attribute.
  67. * @param xmlns The new value for the xmlns attribute.
  68. */
  69. void setXmlns( const xsAnyURI &xmlns ) { attrXmlns = xmlns;
  70. _validAttributeArray[0] = true; }
  71. /**
  72. * Gets the profile attribute.
  73. * @return Returns a xsNMTOKEN of the profile attribute.
  74. */
  75. xsNMTOKEN getProfile() const { return attrProfile; }
  76. /**
  77. * Sets the profile attribute.
  78. * @param atProfile The new value for the profile attribute.
  79. */
  80. void setProfile( xsNMTOKEN atProfile ) { *(daeStringRef*)&attrProfile = atProfile; _validAttributeArray[1] = true; }
  81. /**
  82. * Gets the _contents array.
  83. * @return Returns a reference to the _contents element array.
  84. */
  85. daeElementRefArray &getContents() { return _contents; }
  86. /**
  87. * Gets the _contents array.
  88. * @return Returns a constant reference to the _contents element array.
  89. */
  90. const daeElementRefArray &getContents() const { return _contents; }
  91. protected:
  92. /**
  93. * Constructor
  94. */
  95. domTechnique(DAE& dae) : daeElement(dae), attrXmlns(dae, *this), attrProfile() {}
  96. /**
  97. * Destructor
  98. */
  99. virtual ~domTechnique() {}
  100. /**
  101. * Overloaded assignment operator
  102. */
  103. virtual domTechnique &operator=( const domTechnique &cpy ) { (void)cpy; return *this; }
  104. public: // STATIC METHODS
  105. /**
  106. * Creates an instance of this class and returns a daeElementRef referencing it.
  107. * @return a daeElementRef referencing an instance of this object.
  108. */
  109. static DLLSPEC daeElementRef create(DAE& dae);
  110. /**
  111. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  112. * If a daeMetaElement already exists it will return that instead of creating a new one.
  113. * @return A daeMetaElement describing this COLLADA element.
  114. */
  115. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  116. };
  117. #endif