domVertices.h 4.3 KB

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