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