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 __domCommon_float_or_param_type_h__
     10 #define __domCommon_float_or_param_type_h__
     11 
     12 #include <dae/daeDocument.h>
     13 #include <dom/domTypes.h>
     14 #include <dom/domElements.h>
     15 
     16 class DAE;
     17 
     18 class domCommon_float_or_param_type_complexType
     19 {
     20 public:
     21 	class domFloat;
     22 
     23 	typedef daeSmartRef<domFloat> domFloatRef;
     24 	typedef daeTArray<domFloatRef> domFloat_Array;
     25 
     26 	class domFloat : public daeElement
     27 	{
     28 	public:
     29 		virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::FLOAT; }
     30 		static daeInt ID() { return 113; }
     31 		virtual daeInt typeID() const { return ID(); }
     32 	protected:  // Attribute
     33 		xsNCName attrSid;
     34 
     35 	protected:  // Value
     36 		/**
     37 		 * The ::domFloat value of the text data of this element.
     38 		 */
     39 		::domFloat _value;
     40 
     41 	public:	//Accessors and Mutators
     42 		/**
     43 		 * Gets the sid attribute.
     44 		 * @return Returns a xsNCName of the sid attribute.
     45 		 */
     46 		xsNCName getSid() const { return attrSid; }
     47 		/**
     48 		 * Sets the sid attribute.
     49 		 * @param atSid The new value for the sid attribute.
     50 		 */
     51 		void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
     52 
     53 		/**
     54 		 * Gets the value of this element.
     55 		 * @return a ::domFloat of the value.
     56 		 */
     57 		::domFloat getValue() const { return _value; }
     58 		/**
     59 		 * Sets the _value of this element.
     60 		 * @param val The new value for this element.
     61 		 */
     62 		void setValue( ::domFloat val ) { _value = val; }
     63 
     64 	protected:
     65 		/**
     66 		 * Constructor
     67 		 */
     68 		domFloat(DAE& dae) : daeElement(dae), attrSid(), _value() {}
     69 		/**
     70 		 * Destructor
     71 		 */
     72 		virtual ~domFloat() {}
     73 		/**
     74 		 * Overloaded assignment operator
     75 		 */
     76 		virtual domFloat &operator=( const domFloat &cpy ) { (void)cpy; return *this; }
     77 
     78 	public: // STATIC METHODS
     79 		/**
     80 		 * Creates an instance of this class and returns a daeElementRef referencing it.
     81 		 * @return a daeElementRef referencing an instance of this object.
     82 		 */
     83 		static DLLSPEC daeElementRef create(DAE& dae);
     84 		/**
     85 		 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
     86 		 * If a daeMetaElement already exists it will return that instead of creating a new one.
     87 		 * @return A daeMetaElement describing this COLLADA element.
     88 		 */
     89 		static DLLSPEC daeMetaElement* registerElement(DAE& dae);
     90 	};
     91 
     92 	class domParam;
     93 
     94 	typedef daeSmartRef<domParam> domParamRef;
     95 	typedef daeTArray<domParamRef> domParam_Array;
     96 
     97 	class domParam : public daeElement
     98 	{
     99 	public:
    100 		virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PARAM; }
    101 		static daeInt ID() { return 114; }
    102 		virtual daeInt typeID() const { return ID(); }
    103 	protected:  // Attribute
    104 		xsNCName attrRef;
    105 
    106 
    107 	public:	//Accessors and Mutators
    108 		/**
    109 		 * Gets the ref attribute.
    110 		 * @return Returns a xsNCName of the ref attribute.
    111 		 */
    112 		xsNCName getRef() const { return attrRef; }
    113 		/**
    114 		 * Sets the ref attribute.
    115 		 * @param atRef The new value for the ref attribute.
    116 		 */
    117 		void setRef( xsNCName atRef ) { *(daeStringRef*)&attrRef = atRef; _validAttributeArray[0] = true; }
    118 
    119 	protected:
    120 		/**
    121 		 * Constructor
    122 		 */
    123 		domParam(DAE& dae) : daeElement(dae), attrRef() {}
    124 		/**
    125 		 * Destructor
    126 		 */
    127 		virtual ~domParam() {}
    128 		/**
    129 		 * Overloaded assignment operator
    130 		 */
    131 		virtual domParam &operator=( const domParam &cpy ) { (void)cpy; return *this; }
    132 
    133 	public: // STATIC METHODS
    134 		/**
    135 		 * Creates an instance of this class and returns a daeElementRef referencing it.
    136 		 * @return a daeElementRef referencing an instance of this object.
    137 		 */
    138 		static DLLSPEC daeElementRef create(DAE& dae);
    139 		/**
    140 		 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    141 		 * If a daeMetaElement already exists it will return that instead of creating a new one.
    142 		 * @return A daeMetaElement describing this COLLADA element.
    143 		 */
    144 		static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    145 	};
    146 
    147 
    148 
    149 protected:  // Elements
    150 	domFloatRef elemFloat;
    151 	domParamRef elemParam;
    152 	/**
    153 	 * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
    154 	 */
    155 	daeElementRefArray _contents;
    156 	/**
    157 	 * Used to preserve order in elements that have a complex content model.
    158 	 */
    159 	daeUIntArray       _contentsOrder;
    160 
    161 	/**
    162 	 * Used to store information needed for some content model objects.
    163 	 */
    164 	daeTArray< daeCharArray * > _CMData;
    165 
    166 
    167 public:	//Accessors and Mutators
    168 	/**
    169 	 * Gets the float element.
    170 	 * @return a daeSmartRef to the float element.
    171 	 */
    172 	const domFloatRef getFloat() const { return elemFloat; }
    173 	/**
    174 	 * Gets the param element.
    175 	 * @return a daeSmartRef to the param element.
    176 	 */
    177 	const domParamRef getParam() const { return elemParam; }
    178 	/**
    179 	 * Gets the _contents array.
    180 	 * @return Returns a reference to the _contents element array.
    181 	 */
    182 	daeElementRefArray &getContents() { return _contents; }
    183 	/**
    184 	 * Gets the _contents array.
    185 	 * @return Returns a constant reference to the _contents element array.
    186 	 */
    187 	const daeElementRefArray &getContents() const { return _contents; }
    188 
    189 protected:
    190 	/**
    191 	 * Constructor
    192 	 */
    193 	domCommon_float_or_param_type_complexType(DAE& dae, daeElement* elt) : elemFloat(), elemParam() {}
    194 	/**
    195 	 * Destructor
    196 	 */
    197 	virtual ~domCommon_float_or_param_type_complexType() { daeElement::deleteCMDataArray(_CMData); }
    198 	/**
    199 	 * Overloaded assignment operator
    200 	 */
    201 	virtual domCommon_float_or_param_type_complexType &operator=( const domCommon_float_or_param_type_complexType &cpy ) { (void)cpy; return *this; }
    202 };
    203 
    204 /**
    205  * An element of type domCommon_float_or_param_type_complexType.
    206  */
    207 class domCommon_float_or_param_type : public daeElement, public domCommon_float_or_param_type_complexType
    208 {
    209 public:
    210 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::COMMON_FLOAT_OR_PARAM_TYPE; }
    211 	static daeInt ID() { return 115; }
    212 	virtual daeInt typeID() const { return ID(); }
    213 protected:
    214 	/**
    215 	 * Constructor
    216 	 */
    217 	domCommon_float_or_param_type(DAE& dae) : daeElement(dae), domCommon_float_or_param_type_complexType(dae, this) {}
    218 	/**
    219 	 * Destructor
    220 	 */
    221 	virtual ~domCommon_float_or_param_type() {}
    222 	/**
    223 	 * Overloaded assignment operator
    224 	 */
    225 	virtual domCommon_float_or_param_type &operator=( const domCommon_float_or_param_type &cpy ) { (void)cpy; return *this; }
    226 
    227 public: // STATIC METHODS
    228 	/**
    229 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    230 	 * @return a daeElementRef referencing an instance of this object.
    231 	 */
    232 	static DLLSPEC daeElementRef create(DAE& dae);
    233 	/**
    234 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    235 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    236 	 * @return A daeMetaElement describing this COLLADA element.
    237 	 */
    238 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    239 };
    240 
    241 
    242 #endif
    243