domFloat_array.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #ifndef __domFloat_array_h__
  14. #define __domFloat_array_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The float_array element declares the storage for a homogenous array of
  21. * floating point values.
  22. */
  23. class domFloat_array : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::FLOAT_ARRAY; }
  27. static daeInt ID() { return 607; }
  28. virtual daeInt typeID() const { return ID(); }
  29. protected: // Attributes
  30. /**
  31. * The id attribute is a text string containing the unique identifier of
  32. * this element. This value must be unique within the instance document.
  33. * Optional attribute.
  34. */
  35. xsID attrId;
  36. /**
  37. * The name attribute is the text string name of this element. Optional attribute.
  38. */
  39. xsNCName attrName;
  40. /**
  41. * The count attribute indicates the number of values in the array. Required
  42. * attribute.
  43. */
  44. domUint attrCount;
  45. /**
  46. * The digits attribute indicates the number of significant decimal digits
  47. * of the float values that can be contained in the array. The default value
  48. * is 6. Optional attribute.
  49. */
  50. xsShort attrDigits;
  51. /**
  52. * The magnitude attribute indicates the largest exponent of the float values
  53. * that can be contained in the array. The default value is 38. Optional
  54. * attribute.
  55. */
  56. xsShort attrMagnitude;
  57. protected: // Value
  58. /**
  59. * The domListOfFloats value of the text data of this element.
  60. */
  61. domListOfFloats _value;
  62. public: //Accessors and Mutators
  63. /**
  64. * Gets the id attribute.
  65. * @return Returns a xsID of the id attribute.
  66. */
  67. xsID getId() const { return attrId; }
  68. /**
  69. * Sets the id attribute.
  70. * @param atId The new value for the id attribute.
  71. */
  72. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  73. if( _document != NULL ) _document->changeElementID( this, attrId );
  74. }
  75. /**
  76. * Gets the name attribute.
  77. * @return Returns a xsNCName of the name attribute.
  78. */
  79. xsNCName getName() const { return attrName; }
  80. /**
  81. * Sets the name attribute.
  82. * @param atName The new value for the name attribute.
  83. */
  84. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  85. /**
  86. * Gets the count attribute.
  87. * @return Returns a domUint of the count attribute.
  88. */
  89. domUint getCount() const { return attrCount; }
  90. /**
  91. * Sets the count attribute.
  92. * @param atCount The new value for the count attribute.
  93. */
  94. void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[2] = true; }
  95. /**
  96. * Gets the digits attribute.
  97. * @return Returns a xsShort of the digits attribute.
  98. */
  99. xsShort getDigits() const { return attrDigits; }
  100. /**
  101. * Sets the digits attribute.
  102. * @param atDigits The new value for the digits attribute.
  103. */
  104. void setDigits( xsShort atDigits ) { attrDigits = atDigits; _validAttributeArray[3] = true; }
  105. /**
  106. * Gets the magnitude attribute.
  107. * @return Returns a xsShort of the magnitude attribute.
  108. */
  109. xsShort getMagnitude() const { return attrMagnitude; }
  110. /**
  111. * Sets the magnitude attribute.
  112. * @param atMagnitude The new value for the magnitude attribute.
  113. */
  114. void setMagnitude( xsShort atMagnitude ) { attrMagnitude = atMagnitude; _validAttributeArray[4] = true; }
  115. /**
  116. * Gets the _value array.
  117. * @return Returns a domListOfFloats reference of the _value array.
  118. */
  119. domListOfFloats &getValue() { return _value; }
  120. /**
  121. * Gets the _value array.
  122. * @return Returns a constant domListOfFloats reference of the _value array.
  123. */
  124. const domListOfFloats &getValue() const { return _value; }
  125. /**
  126. * Sets the _value array.
  127. * @param val The new value for the _value array.
  128. */
  129. void setValue( const domListOfFloats &val ) { _value = val; }
  130. protected:
  131. /**
  132. * Constructor
  133. */
  134. domFloat_array(DAE& dae) : daeElement(dae), attrId(), attrName(), attrCount(), attrDigits(), attrMagnitude(), _value() {}
  135. /**
  136. * Destructor
  137. */
  138. virtual ~domFloat_array() {}
  139. /**
  140. * Overloaded assignment operator
  141. */
  142. virtual domFloat_array &operator=( const domFloat_array &cpy ) { (void)cpy; return *this; }
  143. public: // STATIC METHODS
  144. /**
  145. * Creates an instance of this class and returns a daeElementRef referencing it.
  146. * @return a daeElementRef referencing an instance of this object.
  147. */
  148. static DLLSPEC daeElementRef create(DAE& dae);
  149. /**
  150. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  151. * If a daeMetaElement already exists it will return that instead of creating a new one.
  152. * @return A daeMetaElement describing this COLLADA element.
  153. */
  154. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  155. };
  156. #endif