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 __domFloat_array_h__ 10 #define __domFloat_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 float_array element declares the storage for a homogenous array of 20 * floating point values. 21 */ 22 class domFloat_array : public daeElement 23 { 24 public: 25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::FLOAT_ARRAY; } 26 static daeInt ID() { return 607; } 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 digits attribute indicates the number of significant decimal digits 46 * of the float values that can be contained in the array. The default value 47 * is 6. Optional attribute. 48 */ 49 xsShort attrDigits; 50 /** 51 * The magnitude attribute indicates the largest exponent of the float values 52 * that can be contained in the array. The default value is 38. Optional 53 * attribute. 54 */ 55 xsShort attrMagnitude; 56 57 protected: // Value 58 /** 59 * The domListOfFloats value of the text data of this element. 60 */ 61 domListOfFloats _value; 62 63 public: //Accessors and Mutators 64 /** 65 * Gets the id attribute. 66 * @return Returns a xsID of the id attribute. 67 */ 68 xsID getId() const { return attrId; } 69 /** 70 * Sets the id attribute. 71 * @param atId The new value for the id attribute. 72 */ 73 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 74 if( _document != NULL ) _document->changeElementID( this, attrId ); 75 } 76 77 /** 78 * Gets the name attribute. 79 * @return Returns a xsNCName of the name attribute. 80 */ 81 xsNCName getName() const { return attrName; } 82 /** 83 * Sets the name attribute. 84 * @param atName The new value for the name attribute. 85 */ 86 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 87 88 /** 89 * Gets the count attribute. 90 * @return Returns a domUint of the count attribute. 91 */ 92 domUint getCount() const { return attrCount; } 93 /** 94 * Sets the count attribute. 95 * @param atCount The new value for the count attribute. 96 */ 97 void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[2] = true; } 98 99 /** 100 * Gets the digits attribute. 101 * @return Returns a xsShort of the digits attribute. 102 */ 103 xsShort getDigits() const { return attrDigits; } 104 /** 105 * Sets the digits attribute. 106 * @param atDigits The new value for the digits attribute. 107 */ 108 void setDigits( xsShort atDigits ) { attrDigits = atDigits; _validAttributeArray[3] = true; } 109 110 /** 111 * Gets the magnitude attribute. 112 * @return Returns a xsShort of the magnitude attribute. 113 */ 114 xsShort getMagnitude() const { return attrMagnitude; } 115 /** 116 * Sets the magnitude attribute. 117 * @param atMagnitude The new value for the magnitude attribute. 118 */ 119 void setMagnitude( xsShort atMagnitude ) { attrMagnitude = atMagnitude; _validAttributeArray[4] = true; } 120 121 /** 122 * Gets the _value array. 123 * @return Returns a domListOfFloats reference of the _value array. 124 */ 125 domListOfFloats &getValue() { return _value; } 126 /** 127 * Gets the _value array. 128 * @return Returns a constant domListOfFloats reference of the _value array. 129 */ 130 const domListOfFloats &getValue() const { return _value; } 131 /** 132 * Sets the _value array. 133 * @param val The new value for the _value array. 134 */ 135 void setValue( const domListOfFloats &val ) { _value = val; } 136 137 protected: 138 /** 139 * Constructor 140 */ 141 domFloat_array(DAE& dae) : daeElement(dae), attrId(), attrName(), attrCount(), attrDigits(), attrMagnitude(), _value() {} 142 /** 143 * Destructor 144 */ 145 virtual ~domFloat_array() {} 146 /** 147 * Overloaded assignment operator 148 */ 149 virtual domFloat_array &operator=( const domFloat_array &cpy ) { (void)cpy; return *this; } 150 151 public: // STATIC METHODS 152 /** 153 * Creates an instance of this class and returns a daeElementRef referencing it. 154 * @return a daeElementRef referencing an instance of this object. 155 */ 156 static DLLSPEC daeElementRef create(DAE& dae); 157 /** 158 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 159 * If a daeMetaElement already exists it will return that instead of creating a new one. 160 * @return A daeMetaElement describing this COLLADA element. 161 */ 162 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 163 }; 164 165 166 #endif 167