domBind_material.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 __domBind_material_h__
  14. #define __domBind_material_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domParam.h>
  19. #include <dom/domTechnique.h>
  20. #include <dom/domExtra.h>
  21. #include <dom/domInstance_material.h>
  22. class DAE;
  23. /**
  24. * Bind a specific material to a piece of geometry, binding varying and uniform
  25. * parameters at the same time.
  26. */
  27. class domBind_material : public daeElement
  28. {
  29. public:
  30. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BIND_MATERIAL; }
  31. static daeInt ID() { return 686; }
  32. virtual daeInt typeID() const { return ID(); }
  33. public:
  34. class domTechnique_common;
  35. typedef daeSmartRef<domTechnique_common> domTechnique_commonRef;
  36. typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array;
  37. /**
  38. * The technique_common element specifies the bind_material information for
  39. * the common profile which all COLLADA implementations need to support.
  40. */
  41. class domTechnique_common : public daeElement
  42. {
  43. public:
  44. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; }
  45. static daeInt ID() { return 687; }
  46. virtual daeInt typeID() const { return ID(); }
  47. protected: // Element
  48. /**
  49. * The instance_material element specifies the information needed to bind
  50. * a geometry to a material. This element must appear at least once. @see
  51. * domInstance_material
  52. */
  53. domInstance_material_Array elemInstance_material_array;
  54. public: //Accessors and Mutators
  55. /**
  56. * Gets the instance_material element array.
  57. * @return Returns a reference to the array of instance_material elements.
  58. */
  59. domInstance_material_Array &getInstance_material_array() { return elemInstance_material_array; }
  60. /**
  61. * Gets the instance_material element array.
  62. * @return Returns a constant reference to the array of instance_material elements.
  63. */
  64. const domInstance_material_Array &getInstance_material_array() const { return elemInstance_material_array; }
  65. protected:
  66. /**
  67. * Constructor
  68. */
  69. domTechnique_common(DAE& dae) : daeElement(dae), elemInstance_material_array() {}
  70. /**
  71. * Destructor
  72. */
  73. virtual ~domTechnique_common() {}
  74. /**
  75. * Overloaded assignment operator
  76. */
  77. virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; }
  78. public: // STATIC METHODS
  79. /**
  80. * Creates an instance of this class and returns a daeElementRef referencing it.
  81. * @return a daeElementRef referencing an instance of this object.
  82. */
  83. static DLLSPEC daeElementRef create(DAE& dae);
  84. /**
  85. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  86. * If a daeMetaElement already exists it will return that instead of creating a new one.
  87. * @return A daeMetaElement describing this COLLADA element.
  88. */
  89. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  90. };
  91. protected: // Elements
  92. /**
  93. * The bind_material element may contain any number of param elements. @see
  94. * domParam
  95. */
  96. domParam_Array elemParam_array;
  97. /**
  98. * The technique_common element specifies the bind_material information for
  99. * the common profile which all COLLADA implementations need to support.
  100. * @see domTechnique_common
  101. */
  102. domTechnique_commonRef elemTechnique_common;
  103. /**
  104. * This element may contain any number of non-common profile techniques.
  105. * @see domTechnique
  106. */
  107. domTechnique_Array elemTechnique_array;
  108. /**
  109. * The extra element may appear any number of times. @see domExtra
  110. */
  111. domExtra_Array elemExtra_array;
  112. public: //Accessors and Mutators
  113. /**
  114. * Gets the param element array.
  115. * @return Returns a reference to the array of param elements.
  116. */
  117. domParam_Array &getParam_array() { return elemParam_array; }
  118. /**
  119. * Gets the param element array.
  120. * @return Returns a constant reference to the array of param elements.
  121. */
  122. const domParam_Array &getParam_array() const { return elemParam_array; }
  123. /**
  124. * Gets the technique_common element.
  125. * @return a daeSmartRef to the technique_common element.
  126. */
  127. const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; }
  128. /**
  129. * Gets the technique element array.
  130. * @return Returns a reference to the array of technique elements.
  131. */
  132. domTechnique_Array &getTechnique_array() { return elemTechnique_array; }
  133. /**
  134. * Gets the technique element array.
  135. * @return Returns a constant reference to the array of technique elements.
  136. */
  137. const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; }
  138. /**
  139. * Gets the extra element array.
  140. * @return Returns a reference to the array of extra elements.
  141. */
  142. domExtra_Array &getExtra_array() { return elemExtra_array; }
  143. /**
  144. * Gets the extra element array.
  145. * @return Returns a constant reference to the array of extra elements.
  146. */
  147. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  148. protected:
  149. /**
  150. * Constructor
  151. */
  152. domBind_material(DAE& dae) : daeElement(dae), elemParam_array(), elemTechnique_common(), elemTechnique_array(), elemExtra_array() {}
  153. /**
  154. * Destructor
  155. */
  156. virtual ~domBind_material() {}
  157. /**
  158. * Overloaded assignment operator
  159. */
  160. virtual domBind_material &operator=( const domBind_material &cpy ) { (void)cpy; return *this; }
  161. public: // STATIC METHODS
  162. /**
  163. * Creates an instance of this class and returns a daeElementRef referencing it.
  164. * @return a daeElementRef referencing an instance of this object.
  165. */
  166. static DLLSPEC daeElementRef create(DAE& dae);
  167. /**
  168. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  169. * If a daeMetaElement already exists it will return that instead of creating a new one.
  170. * @return A daeMetaElement describing this COLLADA element.
  171. */
  172. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  173. };
  174. #endif