PageRenderTime 26ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/dom/include/1.4/dom/domFx_surface_format_hint_common.h

http://github.com/sbarthelemy/collada-dom
C Header | 397 lines | 132 code | 39 blank | 226 comment | 0 complexity | 062af43198994848c0be1b74b3305216 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the MIT Open Source License, for details please see license.txt or the website
  5. * http://www.opensource.org/licenses/mit-license.php
  6. *
  7. */
  8. #ifndef __domFx_surface_format_hint_common_h__
  9. #define __domFx_surface_format_hint_common_h__
  10. #include <dae/daeDocument.h>
  11. #include <dom/domTypes.h>
  12. #include <dom/domElements.h>
  13. #include <dom/domExtra.h>
  14. class DAE;
  15. /**
  16. * If the exact format cannot be resolve via other methods then the format_hint
  17. * will describe the important features of the format so that the application
  18. * may select a compatable or close format
  19. */
  20. class domFx_surface_format_hint_common_complexType
  21. {
  22. public:
  23. class domChannels;
  24. typedef daeSmartRef<domChannels> domChannelsRef;
  25. typedef daeTArray<domChannelsRef> domChannels_Array;
  26. /**
  27. * The per-texel layout of the format. The length of the string indicate
  28. * how many channels there are and the letter respresents the name of the
  29. * channel. There are typically 0 to 4 channels.
  30. */
  31. class domChannels : public daeElement
  32. {
  33. public:
  34. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CHANNELS; }
  35. static daeInt ID() { return 6; }
  36. virtual daeInt typeID() const { return ID(); }
  37. protected: // Value
  38. /**
  39. * The domFx_surface_format_hint_channels_enum value of the text data of this element.
  40. */
  41. domFx_surface_format_hint_channels_enum _value;
  42. public: //Accessors and Mutators
  43. /**
  44. * Gets the value of this element.
  45. * @return a domFx_surface_format_hint_channels_enum of the value.
  46. */
  47. domFx_surface_format_hint_channels_enum getValue() const { return _value; }
  48. /**
  49. * Sets the _value of this element.
  50. * @param val The new value for this element.
  51. */
  52. void setValue( domFx_surface_format_hint_channels_enum val ) { _value = val; }
  53. protected:
  54. /**
  55. * Constructor
  56. */
  57. domChannels(DAE& dae) : daeElement(dae), _value() {}
  58. /**
  59. * Destructor
  60. */
  61. virtual ~domChannels() {}
  62. /**
  63. * Overloaded assignment operator
  64. */
  65. virtual domChannels &operator=( const domChannels &cpy ) { (void)cpy; return *this; }
  66. public: // STATIC METHODS
  67. /**
  68. * Creates an instance of this class and returns a daeElementRef referencing it.
  69. * @return a daeElementRef referencing an instance of this object.
  70. */
  71. static DLLSPEC daeElementRef create(DAE& dae);
  72. /**
  73. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  74. * If a daeMetaElement already exists it will return that instead of creating a new one.
  75. * @return A daeMetaElement describing this COLLADA element.
  76. */
  77. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  78. };
  79. class domRange;
  80. typedef daeSmartRef<domRange> domRangeRef;
  81. typedef daeTArray<domRangeRef> domRange_Array;
  82. /**
  83. * Each channel represents a range of values. Some example ranges are signed
  84. * or unsigned integers, or between between a clamped range such as 0.0f to
  85. * 1.0f, or high dynamic range via floating point
  86. */
  87. class domRange : public daeElement
  88. {
  89. public:
  90. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::RANGE; }
  91. static daeInt ID() { return 7; }
  92. virtual daeInt typeID() const { return ID(); }
  93. protected: // Value
  94. /**
  95. * The domFx_surface_format_hint_range_enum value of the text data of this element.
  96. */
  97. domFx_surface_format_hint_range_enum _value;
  98. public: //Accessors and Mutators
  99. /**
  100. * Gets the value of this element.
  101. * @return a domFx_surface_format_hint_range_enum of the value.
  102. */
  103. domFx_surface_format_hint_range_enum getValue() const { return _value; }
  104. /**
  105. * Sets the _value of this element.
  106. * @param val The new value for this element.
  107. */
  108. void setValue( domFx_surface_format_hint_range_enum val ) { _value = val; }
  109. protected:
  110. /**
  111. * Constructor
  112. */
  113. domRange(DAE& dae) : daeElement(dae), _value() {}
  114. /**
  115. * Destructor
  116. */
  117. virtual ~domRange() {}
  118. /**
  119. * Overloaded assignment operator
  120. */
  121. virtual domRange &operator=( const domRange &cpy ) { (void)cpy; return *this; }
  122. public: // STATIC METHODS
  123. /**
  124. * Creates an instance of this class and returns a daeElementRef referencing it.
  125. * @return a daeElementRef referencing an instance of this object.
  126. */
  127. static DLLSPEC daeElementRef create(DAE& dae);
  128. /**
  129. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  130. * If a daeMetaElement already exists it will return that instead of creating a new one.
  131. * @return A daeMetaElement describing this COLLADA element.
  132. */
  133. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  134. };
  135. class domPrecision;
  136. typedef daeSmartRef<domPrecision> domPrecisionRef;
  137. typedef daeTArray<domPrecisionRef> domPrecision_Array;
  138. /**
  139. * Each channel of the texel has a precision. Typically these are all linked
  140. * together. An exact format lay lower the precision of an individual channel
  141. * but applying a higher precision by linking the channels together may still
  142. * convey the same information.
  143. */
  144. class domPrecision : public daeElement
  145. {
  146. public:
  147. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PRECISION; }
  148. static daeInt ID() { return 8; }
  149. virtual daeInt typeID() const { return ID(); }
  150. protected: // Value
  151. /**
  152. * The domFx_surface_format_hint_precision_enum value of the text data of this element.
  153. */
  154. domFx_surface_format_hint_precision_enum _value;
  155. public: //Accessors and Mutators
  156. /**
  157. * Gets the value of this element.
  158. * @return a domFx_surface_format_hint_precision_enum of the value.
  159. */
  160. domFx_surface_format_hint_precision_enum getValue() const { return _value; }
  161. /**
  162. * Sets the _value of this element.
  163. * @param val The new value for this element.
  164. */
  165. void setValue( domFx_surface_format_hint_precision_enum val ) { _value = val; }
  166. protected:
  167. /**
  168. * Constructor
  169. */
  170. domPrecision(DAE& dae) : daeElement(dae), _value() {}
  171. /**
  172. * Destructor
  173. */
  174. virtual ~domPrecision() {}
  175. /**
  176. * Overloaded assignment operator
  177. */
  178. virtual domPrecision &operator=( const domPrecision &cpy ) { (void)cpy; return *this; }
  179. public: // STATIC METHODS
  180. /**
  181. * Creates an instance of this class and returns a daeElementRef referencing it.
  182. * @return a daeElementRef referencing an instance of this object.
  183. */
  184. static DLLSPEC daeElementRef create(DAE& dae);
  185. /**
  186. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  187. * If a daeMetaElement already exists it will return that instead of creating a new one.
  188. * @return A daeMetaElement describing this COLLADA element.
  189. */
  190. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  191. };
  192. class domOption;
  193. typedef daeSmartRef<domOption> domOptionRef;
  194. typedef daeTArray<domOptionRef> domOption_Array;
  195. /**
  196. * Additional hints about data relationships and other things to help the
  197. * application pick the best format.
  198. */
  199. class domOption : public daeElement
  200. {
  201. public:
  202. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::OPTION; }
  203. static daeInt ID() { return 9; }
  204. virtual daeInt typeID() const { return ID(); }
  205. protected: // Value
  206. /**
  207. * The domFx_surface_format_hint_option_enum value of the text data of this element.
  208. */
  209. domFx_surface_format_hint_option_enum _value;
  210. public: //Accessors and Mutators
  211. /**
  212. * Gets the value of this element.
  213. * @return a domFx_surface_format_hint_option_enum of the value.
  214. */
  215. domFx_surface_format_hint_option_enum getValue() const { return _value; }
  216. /**
  217. * Sets the _value of this element.
  218. * @param val The new value for this element.
  219. */
  220. void setValue( domFx_surface_format_hint_option_enum val ) { _value = val; }
  221. protected:
  222. /**
  223. * Constructor
  224. */
  225. domOption(DAE& dae) : daeElement(dae), _value() {}
  226. /**
  227. * Destructor
  228. */
  229. virtual ~domOption() {}
  230. /**
  231. * Overloaded assignment operator
  232. */
  233. virtual domOption &operator=( const domOption &cpy ) { (void)cpy; return *this; }
  234. public: // STATIC METHODS
  235. /**
  236. * Creates an instance of this class and returns a daeElementRef referencing it.
  237. * @return a daeElementRef referencing an instance of this object.
  238. */
  239. static DLLSPEC daeElementRef create(DAE& dae);
  240. /**
  241. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  242. * If a daeMetaElement already exists it will return that instead of creating a new one.
  243. * @return A daeMetaElement describing this COLLADA element.
  244. */
  245. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  246. };
  247. protected: // Elements
  248. /**
  249. * The per-texel layout of the format. The length of the string indicate
  250. * how many channels there are and the letter respresents the name of the
  251. * channel. There are typically 0 to 4 channels. @see domChannels
  252. */
  253. domChannelsRef elemChannels;
  254. /**
  255. * Each channel represents a range of values. Some example ranges are signed
  256. * or unsigned integers, or between between a clamped range such as 0.0f to
  257. * 1.0f, or high dynamic range via floating point @see domRange
  258. */
  259. domRangeRef elemRange;
  260. /**
  261. * Each channel of the texel has a precision. Typically these are all linked
  262. * together. An exact format lay lower the precision of an individual channel
  263. * but applying a higher precision by linking the channels together may still
  264. * convey the same information. @see domPrecision
  265. */
  266. domPrecisionRef elemPrecision;
  267. /**
  268. * Additional hints about data relationships and other things to help the
  269. * application pick the best format. @see domOption
  270. */
  271. domOption_Array elemOption_array;
  272. domExtra_Array elemExtra_array;
  273. public: //Accessors and Mutators
  274. /**
  275. * Gets the channels element.
  276. * @return a daeSmartRef to the channels element.
  277. */
  278. const domChannelsRef getChannels() const { return elemChannels; }
  279. /**
  280. * Gets the range element.
  281. * @return a daeSmartRef to the range element.
  282. */
  283. const domRangeRef getRange() const { return elemRange; }
  284. /**
  285. * Gets the precision element.
  286. * @return a daeSmartRef to the precision element.
  287. */
  288. const domPrecisionRef getPrecision() const { return elemPrecision; }
  289. /**
  290. * Gets the option element array.
  291. * @return Returns a reference to the array of option elements.
  292. */
  293. domOption_Array &getOption_array() { return elemOption_array; }
  294. /**
  295. * Gets the option element array.
  296. * @return Returns a constant reference to the array of option elements.
  297. */
  298. const domOption_Array &getOption_array() const { return elemOption_array; }
  299. /**
  300. * Gets the extra element array.
  301. * @return Returns a reference to the array of extra elements.
  302. */
  303. domExtra_Array &getExtra_array() { return elemExtra_array; }
  304. /**
  305. * Gets the extra element array.
  306. * @return Returns a constant reference to the array of extra elements.
  307. */
  308. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  309. protected:
  310. /**
  311. * Constructor
  312. */
  313. domFx_surface_format_hint_common_complexType(DAE& dae, daeElement* elt) : elemChannels(), elemRange(), elemPrecision(), elemOption_array(), elemExtra_array() {}
  314. /**
  315. * Destructor
  316. */
  317. virtual ~domFx_surface_format_hint_common_complexType() {}
  318. /**
  319. * Overloaded assignment operator
  320. */
  321. virtual domFx_surface_format_hint_common_complexType &operator=( const domFx_surface_format_hint_common_complexType &cpy ) { (void)cpy; return *this; }
  322. };
  323. /**
  324. * An element of type domFx_surface_format_hint_common_complexType.
  325. */
  326. class domFx_surface_format_hint_common : public daeElement, public domFx_surface_format_hint_common_complexType
  327. {
  328. public:
  329. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::FX_SURFACE_FORMAT_HINT_COMMON; }
  330. static daeInt ID() { return 10; }
  331. virtual daeInt typeID() const { return ID(); }
  332. protected:
  333. /**
  334. * Constructor
  335. */
  336. domFx_surface_format_hint_common(DAE& dae) : daeElement(dae), domFx_surface_format_hint_common_complexType(dae, this) {}
  337. /**
  338. * Destructor
  339. */
  340. virtual ~domFx_surface_format_hint_common() {}
  341. /**
  342. * Overloaded assignment operator
  343. */
  344. virtual domFx_surface_format_hint_common &operator=( const domFx_surface_format_hint_common &cpy ) { (void)cpy; return *this; }
  345. public: // STATIC METHODS
  346. /**
  347. * Creates an instance of this class and returns a daeElementRef referencing it.
  348. * @return a daeElementRef referencing an instance of this object.
  349. */
  350. static DLLSPEC daeElementRef create(DAE& dae);
  351. /**
  352. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  353. * If a daeMetaElement already exists it will return that instead of creating a new one.
  354. * @return A daeMetaElement describing this COLLADA element.
  355. */
  356. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  357. };
  358. #endif