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