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 __domInt_array_h__ 10 #define __domInt_array_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 class DAE; 17 18 /** 19 * The int_array element declares the storage for a homogenous array of integer 20 * values. 21 */ 22 class domInt_array : public daeElement 23 { 24 public: getElementType()25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INT_ARRAY; } ID()26 static daeInt ID() { return 608; } typeID()27 virtual daeInt typeID() const { return ID(); } 28 protected: // Attributes 29 /** 30 * The id attribute is a text string containing the unique identifier of 31 * this element. This value must be unique within the instance document. 32 * Optional attribute. 33 */ 34 xsID attrId; 35 /** 36 * The name attribute is the text string name of this element. Optional attribute. 37 */ 38 xsNCName attrName; 39 /** 40 * The count attribute indicates the number of values in the array. Required 41 * attribute. 42 */ 43 domUint attrCount; 44 /** 45 * The minInclusive attribute indicates the smallest integer value that can 46 * be contained in the array. The default value is –2147483648. Optional 47 * attribute. 48 */ 49 xsInteger attrMinInclusive; 50 /** 51 * The maxInclusive attribute indicates the largest integer value that can 52 * be contained in the array. The default value is 2147483647. Optional attribute. 53 */ 54 xsInteger attrMaxInclusive; 55 56 protected: // Value 57 /** 58 * The domListOfInts value of the text data of this element. 59 */ 60 domListOfInts _value; 61 62 public: //Accessors and Mutators 63 /** 64 * Gets the id attribute. 65 * @return Returns a xsID of the id attribute. 66 */ getId()67 xsID getId() const { return attrId; } 68 /** 69 * Sets the id attribute. 70 * @param atId The new value for the id attribute. 71 */ setId(xsID atId)72 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 73 if( _document != NULL ) _document->changeElementID( this, attrId ); 74 } 75 76 /** 77 * Gets the name attribute. 78 * @return Returns a xsNCName of the name attribute. 79 */ getName()80 xsNCName getName() const { return attrName; } 81 /** 82 * Sets the name attribute. 83 * @param atName The new value for the name attribute. 84 */ setName(xsNCName atName)85 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 86 87 /** 88 * Gets the count attribute. 89 * @return Returns a domUint of the count attribute. 90 */ getCount()91 domUint getCount() const { return attrCount; } 92 /** 93 * Sets the count attribute. 94 * @param atCount The new value for the count attribute. 95 */ setCount(domUint atCount)96 void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[2] = true; } 97 98 /** 99 * Gets the minInclusive attribute. 100 * @return Returns a xsInteger of the minInclusive attribute. 101 */ getMinInclusive()102 xsInteger getMinInclusive() const { return attrMinInclusive; } 103 /** 104 * Sets the minInclusive attribute. 105 * @param atMinInclusive The new value for the minInclusive attribute. 106 */ setMinInclusive(xsInteger atMinInclusive)107 void setMinInclusive( xsInteger atMinInclusive ) { attrMinInclusive = atMinInclusive; _validAttributeArray[3] = true; } 108 109 /** 110 * Gets the maxInclusive attribute. 111 * @return Returns a xsInteger of the maxInclusive attribute. 112 */ getMaxInclusive()113 xsInteger getMaxInclusive() const { return attrMaxInclusive; } 114 /** 115 * Sets the maxInclusive attribute. 116 * @param atMaxInclusive The new value for the maxInclusive attribute. 117 */ setMaxInclusive(xsInteger atMaxInclusive)118 void setMaxInclusive( xsInteger atMaxInclusive ) { attrMaxInclusive = atMaxInclusive; _validAttributeArray[4] = true; } 119 120 /** 121 * Gets the _value array. 122 * @return Returns a domListOfInts reference of the _value array. 123 */ getValue()124 domListOfInts &getValue() { return _value; } 125 /** 126 * Gets the _value array. 127 * @return Returns a constant domListOfInts reference of the _value array. 128 */ getValue()129 const domListOfInts &getValue() const { return _value; } 130 /** 131 * Sets the _value array. 132 * @param val The new value for the _value array. 133 */ setValue(const domListOfInts & val)134 void setValue( const domListOfInts &val ) { _value = val; } 135 136 protected: 137 /** 138 * Constructor 139 */ domInt_array(DAE & dae)140 domInt_array(DAE& dae) : daeElement(dae), attrId(), attrName(), attrCount(), attrMinInclusive(), attrMaxInclusive(), _value() {} 141 /** 142 * Destructor 143 */ ~domInt_array()144 virtual ~domInt_array() {} 145 /** 146 * Overloaded assignment operator 147 */ 148 virtual domInt_array &operator=( const domInt_array &cpy ) { (void)cpy; return *this; } 149 150 public: // STATIC METHODS 151 /** 152 * Creates an instance of this class and returns a daeElementRef referencing it. 153 * @return a daeElementRef referencing an instance of this object. 154 */ 155 static DLLSPEC daeElementRef create(DAE& dae); 156 /** 157 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 158 * If a daeMetaElement already exists it will return that instead of creating a new one. 159 * @return A daeMetaElement describing this COLLADA element. 160 */ 161 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 162 }; 163 164 165 #endif 166