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_newarray_type_h__
     10 #define __domCg_newarray_type_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_newarray_type.h>
     18 #include <dom/domCg_setuser_type.h>
     19 #include <dom/domCg_connect_param.h>
     20 class DAE;
     21 
     22 /**
     23  * Creates a parameter of a one-dimensional array type.
     24  */
     25 class domCg_newarray_type_complexType
     26 {
     27 protected:  // Attribute
     28 /**
     29  *  The length attribute specifies the length of the array.
     30  */
     31 	xsPositiveInteger attrLength;
     32 
     33 protected:  // Elements
     34 	domCg_param_type_Array elemCg_param_type_array;
     35 /**
     36  * Nested array elements allow you to create multidemensional arrays. @see
     37  * domArray
     38  */
     39 	domCg_newarray_type_Array elemArray_array;
     40 /**
     41  * The usertype element allows you to create arrays of usertypes. @see domUsertype
     42  */
     43 	domCg_setuser_type_Array elemUsertype_array;
     44 	domCg_connect_param_Array elemConnect_param_array;
     45 	/**
     46 	 * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
     47 	 */
     48 	daeElementRefArray _contents;
     49 	/**
     50 	 * Used to preserve order in elements that have a complex content model.
     51 	 */
     52 	daeUIntArray       _contentsOrder;
     53 
     54 	/**
     55 	 * Used to store information needed for some content model objects.
     56 	 */
     57 	daeTArray< daeCharArray * > _CMData;
     58 
     59 
     60 public:	//Accessors and Mutators
     61 	/**
     62 	 * Gets the length attribute.
     63 	 * @return Returns a xsPositiveInteger of the length attribute.
     64 	 */
     65 	xsPositiveInteger getLength() const { return attrLength; }
     66 	/**
     67 	 * Sets the length attribute.
     68 	 * @param atLength The new value for the length attribute.
     69 	 */
     70 	void setLength( xsPositiveInteger atLength ) { attrLength = atLength; }
     71 
     72 	/**
     73 	 * Gets the cg_param_type element array.
     74 	 * @return Returns a reference to the array of cg_param_type elements.
     75 	 */
     76 	domCg_param_type_Array &getCg_param_type_array() { return elemCg_param_type_array; }
     77 	/**
     78 	 * Gets the cg_param_type element array.
     79 	 * @return Returns a constant reference to the array of cg_param_type elements.
     80 	 */
     81 	const domCg_param_type_Array &getCg_param_type_array() const { return elemCg_param_type_array; }
     82 	/**
     83 	 * Gets the array element array.
     84 	 * @return Returns a reference to the array of array elements.
     85 	 */
     86 	domCg_newarray_type_Array &getArray_array() { return elemArray_array; }
     87 	/**
     88 	 * Gets the array element array.
     89 	 * @return Returns a constant reference to the array of array elements.
     90 	 */
     91 	const domCg_newarray_type_Array &getArray_array() const { return elemArray_array; }
     92 	/**
     93 	 * Gets the usertype element array.
     94 	 * @return Returns a reference to the array of usertype elements.
     95 	 */
     96 	domCg_setuser_type_Array &getUsertype_array() { return elemUsertype_array; }
     97 	/**
     98 	 * Gets the usertype element array.
     99 	 * @return Returns a constant reference to the array of usertype elements.
    100 	 */
    101 	const domCg_setuser_type_Array &getUsertype_array() const { return elemUsertype_array; }
    102 	/**
    103 	 * Gets the connect_param element array.
    104 	 * @return Returns a reference to the array of connect_param elements.
    105 	 */
    106 	domCg_connect_param_Array &getConnect_param_array() { return elemConnect_param_array; }
    107 	/**
    108 	 * Gets the connect_param element array.
    109 	 * @return Returns a constant reference to the array of connect_param elements.
    110 	 */
    111 	const domCg_connect_param_Array &getConnect_param_array() const { return elemConnect_param_array; }
    112 	/**
    113 	 * Gets the _contents array.
    114 	 * @return Returns a reference to the _contents element array.
    115 	 */
    116 	daeElementRefArray &getContents() { return _contents; }
    117 	/**
    118 	 * Gets the _contents array.
    119 	 * @return Returns a constant reference to the _contents element array.
    120 	 */
    121 	const daeElementRefArray &getContents() const { return _contents; }
    122 
    123 protected:
    124 	/**
    125 	 * Constructor
    126 	 */
    127 	domCg_newarray_type_complexType(DAE& dae, daeElement* elt) : attrLength(), elemCg_param_type_array(), elemArray_array(), elemUsertype_array(), elemConnect_param_array() {}
    128 	/**
    129 	 * Destructor
    130 	 */
    131 	virtual ~domCg_newarray_type_complexType() { daeElement::deleteCMDataArray(_CMData); }
    132 	/**
    133 	 * Overloaded assignment operator
    134 	 */
    135 	virtual domCg_newarray_type_complexType &operator=( const domCg_newarray_type_complexType &cpy ) { (void)cpy; return *this; }
    136 };
    137 
    138 /**
    139  * An element of type domCg_newarray_type_complexType.
    140  */
    141 class domCg_newarray_type : public daeElement, public domCg_newarray_type_complexType
    142 {
    143 public:
    144 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CG_NEWARRAY_TYPE; }
    145 	static daeInt ID() { return 134; }
    146 	virtual daeInt typeID() const { return ID(); }
    147 
    148 public:	//Accessors and Mutators
    149 	/**
    150 	 * Gets the length attribute.
    151 	 * @return Returns a xsPositiveInteger of the length attribute.
    152 	 */
    153 	xsPositiveInteger getLength() const { return attrLength; }
    154 	/**
    155 	 * Sets the length attribute.
    156 	 * @param atLength The new value for the length attribute.
    157 	 */
    158 	void setLength( xsPositiveInteger atLength ) { attrLength = atLength; _validAttributeArray[0] = true; }
    159 
    160 protected:
    161 	/**
    162 	 * Constructor
    163 	 */
    164 	domCg_newarray_type(DAE& dae) : daeElement(dae), domCg_newarray_type_complexType(dae, this) {}
    165 	/**
    166 	 * Destructor
    167 	 */
    168 	virtual ~domCg_newarray_type() {}
    169 	/**
    170 	 * Overloaded assignment operator
    171 	 */
    172 	virtual domCg_newarray_type &operator=( const domCg_newarray_type &cpy ) { (void)cpy; return *this; }
    173 
    174 public: // STATIC METHODS
    175 	/**
    176 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    177 	 * @return a daeElementRef referencing an instance of this object.
    178 	 */
    179 	static DLLSPEC daeElementRef create(DAE& dae);
    180 	/**
    181 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    182 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    183 	 * @return A daeMetaElement describing this COLLADA element.
    184 	 */
    185 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    186 };
    187 
    188 
    189 #endif
    190