domInputLocalOffset.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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 __domInputLocalOffset_h__
  14. #define __domInputLocalOffset_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The InputLocalOffset type is used to represent indexed inputs that can
  21. * only reference resources declared in the same document.
  22. */
  23. class domInputLocalOffset_complexType
  24. {
  25. protected: // Attributes
  26. /**
  27. * The offset attribute represents the offset into the list of indices.
  28. * If two input elements share the same offset, they will be indexed the
  29. * same. This works as a simple form of compression for the list of indices
  30. * as well as defining the order the inputs should be used in. Required attribute.
  31. */
  32. domUint attrOffset;
  33. /**
  34. * The semantic attribute is the user-defined meaning of the input connection.
  35. * Required attribute.
  36. */
  37. xsNMTOKEN attrSemantic;
  38. /**
  39. * The source attribute indicates the location of the data source. Required
  40. * attribute.
  41. */
  42. domURIFragmentType attrSource;
  43. /**
  44. * The set attribute indicates which inputs should be grouped together as
  45. * a single set. This is helpful when multiple inputs share the same semantics.
  46. */
  47. domUint attrSet;
  48. public: //Accessors and Mutators
  49. /**
  50. * Gets the offset attribute.
  51. * @return Returns a domUint of the offset attribute.
  52. */
  53. domUint getOffset() const { return attrOffset; }
  54. /**
  55. * Sets the offset attribute.
  56. * @param atOffset The new value for the offset attribute.
  57. */
  58. void setOffset( domUint atOffset ) { attrOffset = atOffset; }
  59. /**
  60. * Gets the semantic attribute.
  61. * @return Returns a xsNMTOKEN of the semantic attribute.
  62. */
  63. xsNMTOKEN getSemantic() const { return attrSemantic; }
  64. /**
  65. * Sets the semantic attribute.
  66. * @param atSemantic The new value for the semantic attribute.
  67. */
  68. void setSemantic( xsNMTOKEN atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic;}
  69. /**
  70. * Gets the source attribute.
  71. * @return Returns a domURIFragmentType reference of the source attribute.
  72. */
  73. domURIFragmentType &getSource() { return attrSource; }
  74. /**
  75. * Gets the source attribute.
  76. * @return Returns a constant domURIFragmentType reference of the source attribute.
  77. */
  78. const domURIFragmentType &getSource() const { return attrSource; }
  79. /**
  80. * Sets the source attribute.
  81. * @param atSource The new value for the source attribute.
  82. */
  83. void setSource( const domURIFragmentType &atSource ) { attrSource = atSource; }
  84. /**
  85. * Sets the source attribute.
  86. * @param atSource The new value for the source attribute.
  87. */
  88. void setSource( xsString atSource ) { attrSource = atSource; }
  89. /**
  90. * Gets the set attribute.
  91. * @return Returns a domUint of the set attribute.
  92. */
  93. domUint getSet() const { return attrSet; }
  94. /**
  95. * Sets the set attribute.
  96. * @param atSet The new value for the set attribute.
  97. */
  98. void setSet( domUint atSet ) { attrSet = atSet; }
  99. protected:
  100. /**
  101. * Constructor
  102. */
  103. domInputLocalOffset_complexType(DAE& dae, daeElement* elt) : attrOffset(), attrSemantic(), attrSource(dae, *elt), attrSet() {}
  104. /**
  105. * Destructor
  106. */
  107. virtual ~domInputLocalOffset_complexType() {}
  108. /**
  109. * Overloaded assignment operator
  110. */
  111. virtual domInputLocalOffset_complexType &operator=( const domInputLocalOffset_complexType &cpy ) { (void)cpy; return *this; }
  112. };
  113. /**
  114. * An element of type domInputLocalOffset_complexType.
  115. */
  116. class domInputLocalOffset : public daeElement, public domInputLocalOffset_complexType
  117. {
  118. public:
  119. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INPUTLOCALOFFSET; }
  120. static daeInt ID() { return 2; }
  121. virtual daeInt typeID() const { return ID(); }
  122. public: //Accessors and Mutators
  123. /**
  124. * Gets the offset attribute.
  125. * @return Returns a domUint of the offset attribute.
  126. */
  127. domUint getOffset() const { return attrOffset; }
  128. /**
  129. * Sets the offset attribute.
  130. * @param atOffset The new value for the offset attribute.
  131. */
  132. void setOffset( domUint atOffset ) { attrOffset = atOffset; _validAttributeArray[0] = true; }
  133. /**
  134. * Gets the semantic attribute.
  135. * @return Returns a xsNMTOKEN of the semantic attribute.
  136. */
  137. xsNMTOKEN getSemantic() const { return attrSemantic; }
  138. /**
  139. * Sets the semantic attribute.
  140. * @param atSemantic The new value for the semantic attribute.
  141. */
  142. void setSemantic( xsNMTOKEN atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[1] = true; }
  143. /**
  144. * Gets the source attribute.
  145. * @return Returns a domURIFragmentType reference of the source attribute.
  146. */
  147. domURIFragmentType &getSource() { return attrSource; }
  148. /**
  149. * Gets the source attribute.
  150. * @return Returns a constant domURIFragmentType reference of the source attribute.
  151. */
  152. const domURIFragmentType &getSource() const { return attrSource; }
  153. /**
  154. * Sets the source attribute.
  155. * @param atSource The new value for the source attribute.
  156. */
  157. void setSource( const domURIFragmentType &atSource ) { attrSource = atSource; _validAttributeArray[2] = true; }
  158. /**
  159. * Sets the source attribute.
  160. * @param atSource The new value for the source attribute.
  161. */
  162. void setSource( xsString atSource ) { attrSource = atSource; _validAttributeArray[2] = true; }
  163. /**
  164. * Gets the set attribute.
  165. * @return Returns a domUint of the set attribute.
  166. */
  167. domUint getSet() const { return attrSet; }
  168. /**
  169. * Sets the set attribute.
  170. * @param atSet The new value for the set attribute.
  171. */
  172. void setSet( domUint atSet ) { attrSet = atSet; _validAttributeArray[3] = true; }
  173. protected:
  174. /**
  175. * Constructor
  176. */
  177. domInputLocalOffset(DAE& dae) : daeElement(dae), domInputLocalOffset_complexType(dae, this) {}
  178. /**
  179. * Destructor
  180. */
  181. virtual ~domInputLocalOffset() {}
  182. /**
  183. * Overloaded assignment operator
  184. */
  185. virtual domInputLocalOffset &operator=( const domInputLocalOffset &cpy ) { (void)cpy; return *this; }
  186. public: // STATIC METHODS
  187. /**
  188. * Creates an instance of this class and returns a daeElementRef referencing it.
  189. * @return a daeElementRef referencing an instance of this object.
  190. */
  191. static DLLSPEC daeElementRef create(DAE& dae);
  192. /**
  193. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  194. * If a daeMetaElement already exists it will return that instead of creating a new one.
  195. * @return A daeMetaElement describing this COLLADA element.
  196. */
  197. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  198. };
  199. #endif