domLibrary_geometries.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 __domLibrary_geometries_h__
  14. #define __domLibrary_geometries_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domAsset.h>
  19. #include <dom/domGeometry.h>
  20. #include <dom/domExtra.h>
  21. class DAE;
  22. /**
  23. * The library_geometries element declares a module of geometry elements.
  24. */
  25. class domLibrary_geometries : public daeElement
  26. {
  27. public:
  28. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::LIBRARY_GEOMETRIES; }
  29. static daeInt ID() { return 716; }
  30. virtual daeInt typeID() const { return ID(); }
  31. protected: // Attributes
  32. /**
  33. * The id attribute is a text string containing the unique identifier of
  34. * this element. This value must be unique within the instance document.
  35. * Optional attribute.
  36. */
  37. xsID attrId;
  38. /**
  39. * The name attribute is the text string name of this element. Optional attribute.
  40. */
  41. xsNCName attrName;
  42. protected: // Elements
  43. /**
  44. * The library_geometries element may contain an asset element. @see domAsset
  45. */
  46. domAssetRef elemAsset;
  47. /**
  48. * There must be at least one geometry element. @see domGeometry
  49. */
  50. domGeometry_Array elemGeometry_array;
  51. /**
  52. * The extra element may appear any number of times. @see domExtra
  53. */
  54. domExtra_Array elemExtra_array;
  55. public: //Accessors and Mutators
  56. /**
  57. * Gets the id attribute.
  58. * @return Returns a xsID of the id attribute.
  59. */
  60. xsID getId() const { return attrId; }
  61. /**
  62. * Sets the id attribute.
  63. * @param atId The new value for the id attribute.
  64. */
  65. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  66. if( _document != NULL ) _document->changeElementID( this, attrId );
  67. }
  68. /**
  69. * Gets the name attribute.
  70. * @return Returns a xsNCName of the name attribute.
  71. */
  72. xsNCName getName() const { return attrName; }
  73. /**
  74. * Sets the name attribute.
  75. * @param atName The new value for the name attribute.
  76. */
  77. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  78. /**
  79. * Gets the asset element.
  80. * @return a daeSmartRef to the asset element.
  81. */
  82. const domAssetRef getAsset() const { return elemAsset; }
  83. /**
  84. * Gets the geometry element array.
  85. * @return Returns a reference to the array of geometry elements.
  86. */
  87. domGeometry_Array &getGeometry_array() { return elemGeometry_array; }
  88. /**
  89. * Gets the geometry element array.
  90. * @return Returns a constant reference to the array of geometry elements.
  91. */
  92. const domGeometry_Array &getGeometry_array() const { return elemGeometry_array; }
  93. /**
  94. * Gets the extra element array.
  95. * @return Returns a reference to the array of extra elements.
  96. */
  97. domExtra_Array &getExtra_array() { return elemExtra_array; }
  98. /**
  99. * Gets the extra element array.
  100. * @return Returns a constant reference to the array of extra elements.
  101. */
  102. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  103. protected:
  104. /**
  105. * Constructor
  106. */
  107. domLibrary_geometries(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemGeometry_array(), elemExtra_array() {}
  108. /**
  109. * Destructor
  110. */
  111. virtual ~domLibrary_geometries() {}
  112. /**
  113. * Overloaded assignment operator
  114. */
  115. virtual domLibrary_geometries &operator=( const domLibrary_geometries &cpy ) { (void)cpy; return *this; }
  116. public: // STATIC METHODS
  117. /**
  118. * Creates an instance of this class and returns a daeElementRef referencing it.
  119. * @return a daeElementRef referencing an instance of this object.
  120. */
  121. static DLLSPEC daeElementRef create(DAE& dae);
  122. /**
  123. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  124. * If a daeMetaElement already exists it will return that instead of creating a new one.
  125. * @return A daeMetaElement describing this COLLADA element.
  126. */
  127. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  128. };
  129. #endif