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 __domParam_h__ 10 #define __domParam_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 param element declares parametric information regarding its parent 20 * element. 21 */ 22 class domParam : public daeElement 23 { 24 public: 25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PARAM; } 26 static daeInt ID() { return 610; } 27 virtual daeInt typeID() const { return ID(); } 28 protected: // Attributes 29 /** 30 * The name attribute is the text string name of this element. Optional attribute. 31 */ 32 xsNCName attrName; 33 /** 34 * The sid attribute is a text string value containing the sub-identifier 35 * of this element. This value must be unique within the scope of the parent 36 * element. Optional attribute. 37 */ 38 xsNCName attrSid; 39 /** 40 * The semantic attribute is the user-defined meaning of the parameter. Optional 41 * attribute. 42 */ 43 xsNMTOKEN attrSemantic; 44 /** 45 * The type attribute indicates the type of the value data. This text string 46 * must be understood by the application. Required attribute. 47 */ 48 xsNMTOKEN attrType; 49 50 protected: // Value 51 /** 52 * The xsString value of the text data of this element. 53 */ 54 xsString _value; 55 56 public: //Accessors and Mutators 57 /** 58 * Gets the name attribute. 59 * @return Returns a xsNCName of the name attribute. 60 */ 61 xsNCName getName() const { return attrName; } 62 /** 63 * Sets the name attribute. 64 * @param atName The new value for the name attribute. 65 */ 66 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[0] = true; } 67 68 /** 69 * Gets the sid attribute. 70 * @return Returns a xsNCName of the sid attribute. 71 */ 72 xsNCName getSid() const { return attrSid; } 73 /** 74 * Sets the sid attribute. 75 * @param atSid The new value for the sid attribute. 76 */ 77 void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[1] = true; } 78 79 /** 80 * Gets the semantic attribute. 81 * @return Returns a xsNMTOKEN of the semantic attribute. 82 */ 83 xsNMTOKEN getSemantic() const { return attrSemantic; } 84 /** 85 * Sets the semantic attribute. 86 * @param atSemantic The new value for the semantic attribute. 87 */ 88 void setSemantic( xsNMTOKEN atSemantic ) { *(daeStringRef*)&attrSemantic = atSemantic; _validAttributeArray[2] = true; } 89 90 /** 91 * Gets the type attribute. 92 * @return Returns a xsNMTOKEN of the type attribute. 93 */ 94 xsNMTOKEN getType() const { return attrType; } 95 /** 96 * Sets the type attribute. 97 * @param atType The new value for the type attribute. 98 */ 99 void setType( xsNMTOKEN atType ) { *(daeStringRef*)&attrType = atType; _validAttributeArray[3] = true; } 100 101 /** 102 * Gets the value of this element. 103 * @return Returns a xsString of the value. 104 */ 105 xsString getValue() const { return _value; } 106 /** 107 * Sets the _value of this element. 108 * @param val The new value for this element. 109 */ 110 void setValue( xsString val ) { *(daeStringRef*)&_value = val; } 111 112 protected: 113 /** 114 * Constructor 115 */ 116 domParam(DAE& dae) : daeElement(dae), attrName(), attrSid(), attrSemantic(), attrType(), _value() {} 117 /** 118 * Destructor 119 */ 120 virtual ~domParam() {} 121 /** 122 * Overloaded assignment operator 123 */ 124 virtual domParam &operator=( const domParam &cpy ) { (void)cpy; return *this; } 125 126 public: // STATIC METHODS 127 /** 128 * Creates an instance of this class and returns a daeElementRef referencing it. 129 * @return a daeElementRef referencing an instance of this object. 130 */ 131 static DLLSPEC daeElementRef create(DAE& dae); 132 /** 133 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 134 * If a daeMetaElement already exists it will return that instead of creating a new one. 135 * @return A daeMetaElement describing this COLLADA element. 136 */ 137 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 138 }; 139 140 141 #endif 142