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 __domCg_setparam_h__
     10 #define __domCg_setparam_h__
     11 
     12 #include <dae/daeDocument.h>
     13 #include <dom/domTypes.h>
     14 #include <dom/domElements.h>
     15 
     16 #include <dom/domCg_param_type.h>
     17 #include <dom/domCg_setuser_type.h>
     18 #include <dom/domCg_setarray_type.h>
     19 #include <dom/domCg_connect_param.h>
     20 class DAE;
     21 
     22 /**
     23  * Assigns a new value to a previously defined parameter.
     24  */
     25 class domCg_setparam_complexType
     26 {
     27 protected:  // Attributes
     28 	domCg_identifier attrRef;
     29 	xsNCName attrProgram;
     30 
     31 protected:  // Elements
     32 	domCg_param_typeRef elemCg_param_type;
     33 	domCg_setuser_typeRef elemUsertype;
     34 	domCg_setarray_typeRef elemArray;
     35 	domCg_connect_paramRef elemConnect_param;
     36 	/**
     37 	 * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
     38 	 */
     39 	daeElementRefArray _contents;
     40 	/**
     41 	 * Used to preserve order in elements that have a complex content model.
     42 	 */
     43 	daeUIntArray       _contentsOrder;
     44 
     45 	/**
     46 	 * Used to store information needed for some content model objects.
     47 	 */
     48 	daeTArray< daeCharArray * > _CMData;
     49 
     50 
     51 public:	//Accessors and Mutators
     52 	/**
     53 	 * Gets the ref attribute.
     54 	 * @return Returns a domCg_identifier of the ref attribute.
     55 	 */
     56 	domCg_identifier getRef() const { return attrRef; }
     57 	/**
     58 	 * Sets the ref attribute.
     59 	 * @param atRef The new value for the ref attribute.
     60 	 */
     61 	void setRef( domCg_identifier atRef ) { attrRef = atRef; }
     62 
     63 	/**
     64 	 * Gets the program attribute.
     65 	 * @return Returns a xsNCName of the program attribute.
     66 	 */
     67 	xsNCName getProgram() const { return attrProgram; }
     68 	/**
     69 	 * Sets the program attribute.
     70 	 * @param atProgram The new value for the program attribute.
     71 	 */
     72 	void setProgram( xsNCName atProgram ) { *(daeStringRef*)&attrProgram = atProgram;}
     73 
     74 	/**
     75 	 * Gets the cg_param_type element.
     76 	 * @return a daeSmartRef to the cg_param_type element.
     77 	 */
     78 	const domCg_param_typeRef getCg_param_type() const { return elemCg_param_type; }
     79 	/**
     80 	 * Gets the usertype element.
     81 	 * @return a daeSmartRef to the usertype element.
     82 	 */
     83 	const domCg_setuser_typeRef getUsertype() const { return elemUsertype; }
     84 	/**
     85 	 * Gets the array element.
     86 	 * @return a daeSmartRef to the array element.
     87 	 */
     88 	const domCg_setarray_typeRef getArray() const { return elemArray; }
     89 	/**
     90 	 * Gets the connect_param element.
     91 	 * @return a daeSmartRef to the connect_param element.
     92 	 */
     93 	const domCg_connect_paramRef getConnect_param() const { return elemConnect_param; }
     94 	/**
     95 	 * Gets the _contents array.
     96 	 * @return Returns a reference to the _contents element array.
     97 	 */
     98 	daeElementRefArray &getContents() { return _contents; }
     99 	/**
    100 	 * Gets the _contents array.
    101 	 * @return Returns a constant reference to the _contents element array.
    102 	 */
    103 	const daeElementRefArray &getContents() const { return _contents; }
    104 
    105 protected:
    106 	/**
    107 	 * Constructor
    108 	 */
    109 	domCg_setparam_complexType(DAE& dae, daeElement* elt) : attrRef(), attrProgram(), elemCg_param_type(), elemUsertype(), elemArray(), elemConnect_param() {}
    110 	/**
    111 	 * Destructor
    112 	 */
    113 	virtual ~domCg_setparam_complexType() { daeElement::deleteCMDataArray(_CMData); }
    114 	/**
    115 	 * Overloaded assignment operator
    116 	 */
    117 	virtual domCg_setparam_complexType &operator=( const domCg_setparam_complexType &cpy ) { (void)cpy; return *this; }
    118 };
    119 
    120 /**
    121  * An element of type domCg_setparam_complexType.
    122  */
    123 class domCg_setparam : public daeElement, public domCg_setparam_complexType
    124 {
    125 public:
    126 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CG_SETPARAM; }
    127 	static daeInt ID() { return 144; }
    128 	virtual daeInt typeID() const { return ID(); }
    129 
    130 public:	//Accessors and Mutators
    131 	/**
    132 	 * Gets the ref attribute.
    133 	 * @return Returns a domCg_identifier of the ref attribute.
    134 	 */
    135 	domCg_identifier getRef() const { return attrRef; }
    136 	/**
    137 	 * Sets the ref attribute.
    138 	 * @param atRef The new value for the ref attribute.
    139 	 */
    140 	void setRef( domCg_identifier atRef ) { attrRef = atRef; _validAttributeArray[0] = true; }
    141 
    142 	/**
    143 	 * Gets the program attribute.
    144 	 * @return Returns a xsNCName of the program attribute.
    145 	 */
    146 	xsNCName getProgram() const { return attrProgram; }
    147 	/**
    148 	 * Sets the program attribute.
    149 	 * @param atProgram The new value for the program attribute.
    150 	 */
    151 	void setProgram( xsNCName atProgram ) { *(daeStringRef*)&attrProgram = atProgram; _validAttributeArray[1] = true; }
    152 
    153 protected:
    154 	/**
    155 	 * Constructor
    156 	 */
    157 	domCg_setparam(DAE& dae) : daeElement(dae), domCg_setparam_complexType(dae, this) {}
    158 	/**
    159 	 * Destructor
    160 	 */
    161 	virtual ~domCg_setparam() {}
    162 	/**
    163 	 * Overloaded assignment operator
    164 	 */
    165 	virtual domCg_setparam &operator=( const domCg_setparam &cpy ) { (void)cpy; return *this; }
    166 
    167 public: // STATIC METHODS
    168 	/**
    169 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    170 	 * @return a daeElementRef referencing an instance of this object.
    171 	 */
    172 	static DLLSPEC daeElementRef create(DAE& dae);
    173 	/**
    174 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    175 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    176 	 * @return A daeMetaElement describing this COLLADA element.
    177 	 */
    178 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    179 };
    180 
    181 
    182 #endif
    183