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 __domInstance_effect_h__
     10 #define __domInstance_effect_h__
     11 
     12 #include <dae/daeDocument.h>
     13 #include <dom/domTypes.h>
     14 #include <dom/domElements.h>
     15 
     16 #include <dom/domExtra.h>
     17 #include <dom/domFx_basic_type_common.h>
     18 class DAE;
     19 
     20 /**
     21  * The instance_effect element declares the instantiation of a COLLADA effect
     22  * resource.
     23  */
     24 class domInstance_effect : public daeElement
     25 {
     26 public:
     27 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INSTANCE_EFFECT; }
     28 	static daeInt ID() { return 691; }
     29 	virtual daeInt typeID() const { return ID(); }
     30 public:
     31 	class domTechnique_hint;
     32 
     33 	typedef daeSmartRef<domTechnique_hint> domTechnique_hintRef;
     34 	typedef daeTArray<domTechnique_hintRef> domTechnique_hint_Array;
     35 
     36 /**
     37  * Add a hint for a platform of which technique to use in this effect.
     38  */
     39 	class domTechnique_hint : public daeElement
     40 	{
     41 	public:
     42 		virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_HINT; }
     43 		static daeInt ID() { return 692; }
     44 		virtual daeInt typeID() const { return ID(); }
     45 	protected:  // Attributes
     46 /**
     47  *  A platform defines a string that specifies which platform this is hint
     48  * is aimed for.
     49  */
     50 		xsNCName attrPlatform;
     51 /**
     52  *  A profile defines a string that specifies which API profile this is hint
     53  * is aimed for.
     54  */
     55 		xsNCName attrProfile;
     56 /**
     57  *  A reference to the technique to use for the specified platform.
     58  */
     59 		xsNCName attrRef;
     60 
     61 
     62 	public:	//Accessors and Mutators
     63 		/**
     64 		 * Gets the platform attribute.
     65 		 * @return Returns a xsNCName of the platform attribute.
     66 		 */
     67 		xsNCName getPlatform() const { return attrPlatform; }
     68 		/**
     69 		 * Sets the platform attribute.
     70 		 * @param atPlatform The new value for the platform attribute.
     71 		 */
     72 		void setPlatform( xsNCName atPlatform ) { *(daeStringRef*)&attrPlatform = atPlatform; _validAttributeArray[0] = true; }
     73 
     74 		/**
     75 		 * Gets the profile attribute.
     76 		 * @return Returns a xsNCName of the profile attribute.
     77 		 */
     78 		xsNCName getProfile() const { return attrProfile; }
     79 		/**
     80 		 * Sets the profile attribute.
     81 		 * @param atProfile The new value for the profile attribute.
     82 		 */
     83 		void setProfile( xsNCName atProfile ) { *(daeStringRef*)&attrProfile = atProfile; _validAttributeArray[1] = true; }
     84 
     85 		/**
     86 		 * Gets the ref attribute.
     87 		 * @return Returns a xsNCName of the ref attribute.
     88 		 */
     89 		xsNCName getRef() const { return attrRef; }
     90 		/**
     91 		 * Sets the ref attribute.
     92 		 * @param atRef The new value for the ref attribute.
     93 		 */
     94 		void setRef( xsNCName atRef ) { *(daeStringRef*)&attrRef = atRef; _validAttributeArray[2] = true; }
     95 
     96 	protected:
     97 		/**
     98 		 * Constructor
     99 		 */
    100 		domTechnique_hint(DAE& dae) : daeElement(dae), attrPlatform(), attrProfile(), attrRef() {}
    101 		/**
    102 		 * Destructor
    103 		 */
    104 		virtual ~domTechnique_hint() {}
    105 		/**
    106 		 * Overloaded assignment operator
    107 		 */
    108 		virtual domTechnique_hint &operator=( const domTechnique_hint &cpy ) { (void)cpy; return *this; }
    109 
    110 	public: // STATIC METHODS
    111 		/**
    112 		 * Creates an instance of this class and returns a daeElementRef referencing it.
    113 		 * @return a daeElementRef referencing an instance of this object.
    114 		 */
    115 		static DLLSPEC daeElementRef create(DAE& dae);
    116 		/**
    117 		 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    118 		 * If a daeMetaElement already exists it will return that instead of creating a new one.
    119 		 * @return A daeMetaElement describing this COLLADA element.
    120 		 */
    121 		static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    122 	};
    123 
    124 	class domSetparam;
    125 
    126 	typedef daeSmartRef<domSetparam> domSetparamRef;
    127 	typedef daeTArray<domSetparamRef> domSetparam_Array;
    128 
    129 /**
    130  * Assigns a new value to a previously defined parameter
    131  */
    132 	class domSetparam : public daeElement
    133 	{
    134 	public:
    135 		virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SETPARAM; }
    136 		static daeInt ID() { return 693; }
    137 		virtual daeInt typeID() const { return ID(); }
    138 	protected:  // Attribute
    139 		xsToken attrRef;
    140 
    141 	protected:  // Element
    142 		domFx_basic_type_commonRef elemFx_basic_type_common;
    143 
    144 	public:	//Accessors and Mutators
    145 		/**
    146 		 * Gets the ref attribute.
    147 		 * @return Returns a xsToken of the ref attribute.
    148 		 */
    149 		xsToken getRef() const { return attrRef; }
    150 		/**
    151 		 * Sets the ref attribute.
    152 		 * @param atRef The new value for the ref attribute.
    153 		 */
    154 		void setRef( xsToken atRef ) { *(daeStringRef*)&attrRef = atRef; _validAttributeArray[0] = true; }
    155 
    156 		/**
    157 		 * Gets the fx_basic_type_common element.
    158 		 * @return a daeSmartRef to the fx_basic_type_common element.
    159 		 */
    160 		const domFx_basic_type_commonRef getFx_basic_type_common() const { return elemFx_basic_type_common; }
    161 	protected:
    162 		/**
    163 		 * Constructor
    164 		 */
    165 		domSetparam(DAE& dae) : daeElement(dae), attrRef(), elemFx_basic_type_common() {}
    166 		/**
    167 		 * Destructor
    168 		 */
    169 		virtual ~domSetparam() {}
    170 		/**
    171 		 * Overloaded assignment operator
    172 		 */
    173 		virtual domSetparam &operator=( const domSetparam &cpy ) { (void)cpy; return *this; }
    174 
    175 	public: // STATIC METHODS
    176 		/**
    177 		 * Creates an instance of this class and returns a daeElementRef referencing it.
    178 		 * @return a daeElementRef referencing an instance of this object.
    179 		 */
    180 		static DLLSPEC daeElementRef create(DAE& dae);
    181 		/**
    182 		 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    183 		 * If a daeMetaElement already exists it will return that instead of creating a new one.
    184 		 * @return A daeMetaElement describing this COLLADA element.
    185 		 */
    186 		static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    187 	};
    188 
    189 
    190 protected:  // Attributes
    191 /**
    192  *  The url attribute refers to resource.  This may refer to a local resource
    193  * using a relative URL  fragment identifier that begins with the #
    194  * character. The url attribute may refer to an external  resource using an
    195  * absolute or relative URL.
    196  */
    197 	xsAnyURI attrUrl;
    198 /**
    199  *  The sid attribute is a text string value containing the sub-identifier
    200  * of this element. This  value must be unique within the scope of the parent
    201  * element. Optional attribute.
    202  */
    203 	xsNCName attrSid;
    204 /**
    205  *  The name attribute is the text string name of this element. Optional attribute.
    206  */
    207 	xsNCName attrName;
    208 
    209 protected:  // Elements
    210 /**
    211  * Add a hint for a platform of which technique to use in this effect. @see
    212  * domTechnique_hint
    213  */
    214 	domTechnique_hint_Array elemTechnique_hint_array;
    215 /**
    216  * Assigns a new value to a previously defined parameter @see domSetparam
    217  */
    218 	domSetparam_Array elemSetparam_array;
    219 /**
    220  *  The extra element may appear any number of times.  @see domExtra
    221  */
    222 	domExtra_Array elemExtra_array;
    223 
    224 public:	//Accessors and Mutators
    225 	/**
    226 	 * Gets the url attribute.
    227 	 * @return Returns a xsAnyURI reference of the url attribute.
    228 	 */
    229 	xsAnyURI &getUrl() { return attrUrl; }
    230 	/**
    231 	 * Gets the url attribute.
    232 	 * @return Returns a constant xsAnyURI reference of the url attribute.
    233 	 */
    234 	const xsAnyURI &getUrl() const { return attrUrl; }
    235 	/**
    236 	 * Sets the url attribute.
    237 	 * @param atUrl The new value for the url attribute.
    238 	 */
    239 	void setUrl( const xsAnyURI &atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
    240 	/**
    241 	 * Sets the url attribute.
    242 	 * @param atUrl The new value for the url attribute.
    243 	 */
    244 	void setUrl( xsString atUrl ) { attrUrl = atUrl; _validAttributeArray[0] = true; }
    245 
    246 	/**
    247 	 * Gets the sid attribute.
    248 	 * @return Returns a xsNCName of the sid attribute.
    249 	 */
    250 	xsNCName getSid() const { return attrSid; }
    251 	/**
    252 	 * Sets the sid attribute.
    253 	 * @param atSid The new value for the sid attribute.
    254 	 */
    255 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; }
    256 
    257 	/**
    258 	 * Gets the name attribute.
    259 	 * @return Returns a xsNCName of the name attribute.
    260 	 */
    261 	xsNCName getName() const { return attrName; }
    262 	/**
    263 	 * Sets the name attribute.
    264 	 * @param atName The new value for the name attribute.
    265 	 */
    266 	void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[2] = true; }
    267 
    268 	/**
    269 	 * Gets the technique_hint element array.
    270 	 * @return Returns a reference to the array of technique_hint elements.
    271 	 */
    272 	domTechnique_hint_Array &getTechnique_hint_array() { return elemTechnique_hint_array; }
    273 	/**
    274 	 * Gets the technique_hint element array.
    275 	 * @return Returns a constant reference to the array of technique_hint elements.
    276 	 */
    277 	const domTechnique_hint_Array &getTechnique_hint_array() const { return elemTechnique_hint_array; }
    278 	/**
    279 	 * Gets the setparam element array.
    280 	 * @return Returns a reference to the array of setparam elements.
    281 	 */
    282 	domSetparam_Array &getSetparam_array() { return elemSetparam_array; }
    283 	/**
    284 	 * Gets the setparam element array.
    285 	 * @return Returns a constant reference to the array of setparam elements.
    286 	 */
    287 	const domSetparam_Array &getSetparam_array() const { return elemSetparam_array; }
    288 	/**
    289 	 * Gets the extra element array.
    290 	 * @return Returns a reference to the array of extra elements.
    291 	 */
    292 	domExtra_Array &getExtra_array() { return elemExtra_array; }
    293 	/**
    294 	 * Gets the extra element array.
    295 	 * @return Returns a constant reference to the array of extra elements.
    296 	 */
    297 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
    298 protected:
    299 	/**
    300 	 * Constructor
    301 	 */
    302 	domInstance_effect(DAE& dae) : daeElement(dae), attrUrl(dae, *this), attrSid(), attrName(), elemTechnique_hint_array(), elemSetparam_array(), elemExtra_array() {}
    303 	/**
    304 	 * Destructor
    305 	 */
    306 	virtual ~domInstance_effect() {}
    307 	/**
    308 	 * Overloaded assignment operator
    309 	 */
    310 	virtual domInstance_effect &operator=( const domInstance_effect &cpy ) { (void)cpy; return *this; }
    311 
    312 public: // STATIC METHODS
    313 	/**
    314 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    315 	 * @return a daeElementRef referencing an instance of this object.
    316 	 */
    317 	static DLLSPEC daeElementRef create(DAE& dae);
    318 	/**
    319 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    320 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    321 	 * @return A daeMetaElement describing this COLLADA element.
    322 	 */
    323 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    324 };
    325 
    326 
    327 #endif
    328