domInstance_geometry.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 __domInstance_geometry_h__
  14. #define __domInstance_geometry_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domBind_material.h>
  19. #include <dom/domExtra.h>
  20. class DAE;
  21. /**
  22. * The instance_geometry element declares the instantiation of a COLLADA geometry
  23. * resource.
  24. */
  25. class domInstance_geometry : public daeElement
  26. {
  27. public:
  28. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_GEOMETRY; }
  29. static daeInt ID() { return 695; }
  30. virtual daeInt typeID() const { return ID(); }
  31. protected: // Attributes
  32. /**
  33. * The url attribute refers to resource. This may refer to a local resource
  34. * using a relative URL fragment identifier that begins with the “#”
  35. * character. The url attribute may refer to an external resource using an
  36. * absolute or relative URL.
  37. */
  38. xsAnyURI attrUrl;
  39. /**
  40. * The sid attribute is a text string value containing the sub-identifier
  41. * of this element. This value must be unique within the scope of the parent
  42. * element. Optional attribute.
  43. */
  44. xsNCName attrSid;
  45. /**
  46. * The name attribute is the text string name of this element. Optional attribute.
  47. */
  48. xsNCName attrName;
  49. protected: // Elements
  50. /**
  51. * Bind a specific material to a piece of geometry, binding varying and uniform
  52. * parameters at the same time. @see domBind_material
  53. */
  54. domBind_materialRef elemBind_material;
  55. /**
  56. * The extra element may appear any number of times. @see domExtra
  57. */
  58. domExtra_Array elemExtra_array;
  59. public: //Accessors and Mutators
  60. /**
  61. * Gets the url attribute.
  62. * @return Returns a xsAnyURI reference of the url attribute.
  63. */
  64. xsAnyURI &getUrl() { return attrUrl; }
  65. /**
  66. * Gets the url attribute.
  67. * @return Returns a constant xsAnyURI reference of the url attribute.
  68. */
  69. const xsAnyURI &getUrl() const { return attrUrl; }
  70. /**
  71. * Sets the url attribute.
  72. * @param atUrl The new value for the url attribute.
  73. */
  74. void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
  75. /**
  76. * Sets the url attribute.
  77. * @param atUrl The new value for the url attribute.
  78. */
  79. void setUrl( xsString atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
  80. /**
  81. * Gets the sid attribute.
  82. * @return Returns a xsNCName of the sid attribute.
  83. */
  84. xsNCName getSid() const { return attrSid; }
  85. /**
  86. * Sets the sid attribute.
  87. * @param atSid The new value for the sid attribute.
  88. */
  89. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; }
  90. /**
  91. * Gets the name attribute.
  92. * @return Returns a xsNCName of the name attribute.
  93. */
  94. xsNCName getName() const { return attrName; }
  95. /**
  96. * Sets the name attribute.
  97. * @param atName The new value for the name attribute.
  98. */
  99. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[2] = true; }
  100. /**
  101. * Gets the bind_material element.
  102. * @return a daeSmartRef to the bind_material element.
  103. */
  104. const domBind_materialRef getBind_material() const { return elemBind_material; }
  105. /**
  106. * Gets the extra element array.
  107. * @return Returns a reference to the array of extra elements.
  108. */
  109. domExtra_Array &getExtra_array() { return elemExtra_array; }
  110. /**
  111. * Gets the extra element array.
  112. * @return Returns a constant reference to the array of extra elements.
  113. */
  114. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  115. protected:
  116. /**
  117. * Constructor
  118. */
  119. domInstance_geometry(DAE& dae) : daeElement(dae), attrUrl(dae, *this), attrSid(), attrName(), elemBind_material(), elemExtra_array() {}
  120. /**
  121. * Destructor
  122. */
  123. virtual ~domInstance_geometry() {}
  124. /**
  125. * Overloaded assignment operator
  126. */
  127. virtual domInstance_geometry &operator=( const domInstance_geometry &cpy ) { (void)cpy; return *this; }
  128. public: // STATIC METHODS
  129. /**
  130. * Creates an instance of this class and returns a daeElementRef referencing it.
  131. * @return a daeElementRef referencing an instance of this object.
  132. */
  133. static DLLSPEC daeElementRef create(DAE& dae);
  134. /**
  135. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  136. * If a daeMetaElement already exists it will return that instead of creating a new one.
  137. * @return A daeMetaElement describing this COLLADA element.
  138. */
  139. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  140. };
  141. #endif