domGlsl_setparam.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 __domGlsl_setparam_h__
  14. #define __domGlsl_setparam_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domGlsl_param_type.h>
  19. #include <dom/domFx_annotate_common.h>
  20. #include <dom/domGlsl_setarray_type.h>
  21. class DAE;
  22. class domGlsl_setparam_complexType
  23. {
  24. protected: // Attributes
  25. domGlsl_identifier attrRef;
  26. xsNCName attrProgram;
  27. protected: // Elements
  28. domFx_annotate_common_Array elemAnnotate_array;
  29. domGlsl_param_typeRef elemGlsl_param_type;
  30. domGlsl_setarray_typeRef elemArray;
  31. /**
  32. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  33. */
  34. daeElementRefArray _contents;
  35. /**
  36. * Used to preserve order in elements that have a complex content model.
  37. */
  38. daeUIntArray _contentsOrder;
  39. /**
  40. * Used to store information needed for some content model objects.
  41. */
  42. daeTArray< daeCharArray * > _CMData;
  43. public: //Accessors and Mutators
  44. /**
  45. * Gets the ref attribute.
  46. * @return Returns a domGlsl_identifier of the ref attribute.
  47. */
  48. domGlsl_identifier getRef() const { return attrRef; }
  49. /**
  50. * Sets the ref attribute.
  51. * @param atRef The new value for the ref attribute.
  52. */
  53. void setRef( domGlsl_identifier atRef ) { attrRef = atRef; }
  54. /**
  55. * Gets the program attribute.
  56. * @return Returns a xsNCName of the program attribute.
  57. */
  58. xsNCName getProgram() const { return attrProgram; }
  59. /**
  60. * Sets the program attribute.
  61. * @param atProgram The new value for the program attribute.
  62. */
  63. void setProgram( xsNCName atProgram ) { *(daeStringRef*)&attrProgram = atProgram;}
  64. /**
  65. * Gets the annotate element array.
  66. * @return Returns a reference to the array of annotate elements.
  67. */
  68. domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; }
  69. /**
  70. * Gets the annotate element array.
  71. * @return Returns a constant reference to the array of annotate elements.
  72. */
  73. const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; }
  74. /**
  75. * Gets the glsl_param_type element.
  76. * @return a daeSmartRef to the glsl_param_type element.
  77. */
  78. const domGlsl_param_typeRef getGlsl_param_type() const { return elemGlsl_param_type; }
  79. /**
  80. * Gets the array element.
  81. * @return a daeSmartRef to the array element.
  82. */
  83. const domGlsl_setarray_typeRef getArray() const { return elemArray; }
  84. /**
  85. * Gets the _contents array.
  86. * @return Returns a reference to the _contents element array.
  87. */
  88. daeElementRefArray &getContents() { return _contents; }
  89. /**
  90. * Gets the _contents array.
  91. * @return Returns a constant reference to the _contents element array.
  92. */
  93. const daeElementRefArray &getContents() const { return _contents; }
  94. protected:
  95. /**
  96. * Constructor
  97. */
  98. domGlsl_setparam_complexType(DAE& dae, daeElement* elt) : attrRef(), attrProgram(), elemAnnotate_array(), elemGlsl_param_type(), elemArray() {}
  99. /**
  100. * Destructor
  101. */
  102. virtual ~domGlsl_setparam_complexType() { daeElement::deleteCMDataArray(_CMData); }
  103. /**
  104. * Overloaded assignment operator
  105. */
  106. virtual domGlsl_setparam_complexType &operator=( const domGlsl_setparam_complexType &cpy ) { (void)cpy; return *this; }
  107. };
  108. /**
  109. * An element of type domGlsl_setparam_complexType.
  110. */
  111. class domGlsl_setparam : public daeElement, public domGlsl_setparam_complexType
  112. {
  113. public:
  114. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::GLSL_SETPARAM; }
  115. static daeInt ID() { return 112; }
  116. virtual daeInt typeID() const { return ID(); }
  117. public: //Accessors and Mutators
  118. /**
  119. * Gets the ref attribute.
  120. * @return Returns a domGlsl_identifier of the ref attribute.
  121. */
  122. domGlsl_identifier getRef() const { return attrRef; }
  123. /**
  124. * Sets the ref attribute.
  125. * @param atRef The new value for the ref attribute.
  126. */
  127. void setRef( domGlsl_identifier atRef ) { attrRef = atRef; _validAttributeArray[0] = true; }
  128. /**
  129. * Gets the program attribute.
  130. * @return Returns a xsNCName of the program attribute.
  131. */
  132. xsNCName getProgram() const { return attrProgram; }
  133. /**
  134. * Sets the program attribute.
  135. * @param atProgram The new value for the program attribute.
  136. */
  137. void setProgram( xsNCName atProgram ) { *(daeStringRef*)&attrProgram = atProgram; _validAttributeArray[1] = true; }
  138. protected:
  139. /**
  140. * Constructor
  141. */
  142. domGlsl_setparam(DAE& dae) : daeElement(dae), domGlsl_setparam_complexType(dae, this) {}
  143. /**
  144. * Destructor
  145. */
  146. virtual ~domGlsl_setparam() {}
  147. /**
  148. * Overloaded assignment operator
  149. */
  150. virtual domGlsl_setparam &operator=( const domGlsl_setparam &cpy ) { (void)cpy; return *this; }
  151. public: // STATIC METHODS
  152. /**
  153. * Creates an instance of this class and returns a daeElementRef referencing it.
  154. * @return a daeElementRef referencing an instance of this object.
  155. */
  156. static DLLSPEC daeElementRef create(DAE& dae);
  157. /**
  158. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  159. * If a daeMetaElement already exists it will return that instead of creating a new one.
  160. * @return A daeMetaElement describing this COLLADA element.
  161. */
  162. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  163. };
  164. #endif