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