domCg_setparam.h 5.7 KB

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