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 __domGlsl_setparam_h__ 10 #define __domGlsl_setparam_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 #include <dom/domGlsl_param_type.h> 17 #include <dom/domFx_annotate_common.h> 18 #include <dom/domGlsl_setarray_type.h> 19 class DAE; 20 21 class domGlsl_setparam_complexType 22 { 23 protected: // Attributes 24 domGlsl_identifier attrRef; 25 xsNCName attrProgram; 26 27 protected: // Elements 28 domFx_annotate_common_Array elemAnnotate_array; 29 domGlsl_param_typeRef elemGlsl_param_type; 30 domGlsl_setarray_typeRef elemArray; 31 /** 32 * Used to preserve order in elements that do not specify strict sequencing of sub-elements. 33 */ 34 daeElementRefArray _contents; 35 /** 36 * Used to preserve order in elements that have a complex content model. 37 */ 38 daeUIntArray _contentsOrder; 39 40 /** 41 * Used to store information needed for some content model objects. 42 */ 43 daeTArray< daeCharArray * > _CMData; 44 45 46 public: //Accessors and Mutators 47 /** 48 * Gets the ref attribute. 49 * @return Returns a domGlsl_identifier of the ref attribute. 50 */ 51 domGlsl_identifier getRef() const { return attrRef; } 52 /** 53 * Sets the ref attribute. 54 * @param atRef The new value for the ref attribute. 55 */ 56 void setRef( domGlsl_identifier atRef ) { attrRef = atRef; } 57 58 /** 59 * Gets the program attribute. 60 * @return Returns a xsNCName of the program attribute. 61 */ 62 xsNCName getProgram() const { return attrProgram; } 63 /** 64 * Sets the program attribute. 65 * @param atProgram The new value for the program attribute. 66 */ 67 void setProgram( xsNCName atProgram ) { *(daeStringRef*)&attrProgram = atProgram;} 68 69 /** 70 * Gets the annotate element array. 71 * @return Returns a reference to the array of annotate elements. 72 */ 73 domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; } 74 /** 75 * Gets the annotate element array. 76 * @return Returns a constant reference to the array of annotate elements. 77 */ 78 const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; } 79 /** 80 * Gets the glsl_param_type element. 81 * @return a daeSmartRef to the glsl_param_type element. 82 */ 83 const domGlsl_param_typeRef getGlsl_param_type() const { return elemGlsl_param_type; } 84 /** 85 * Gets the array element. 86 * @return a daeSmartRef to the array element. 87 */ 88 const domGlsl_setarray_typeRef getArray() const { return elemArray; } 89 /** 90 * Gets the _contents array. 91 * @return Returns a reference to the _contents element array. 92 */ 93 daeElementRefArray &getContents() { return _contents; } 94 /** 95 * Gets the _contents array. 96 * @return Returns a constant reference to the _contents element array. 97 */ 98 const daeElementRefArray &getContents() const { return _contents; } 99 100 protected: 101 /** 102 * Constructor 103 */ 104 domGlsl_setparam_complexType(DAE& dae, daeElement* elt) : attrRef(), attrProgram(), elemAnnotate_array(), elemGlsl_param_type(), elemArray() {} 105 /** 106 * Destructor 107 */ 108 virtual ~domGlsl_setparam_complexType() { daeElement::deleteCMDataArray(_CMData); } 109 /** 110 * Overloaded assignment operator 111 */ 112 virtual domGlsl_setparam_complexType &operator=( const domGlsl_setparam_complexType &cpy ) { (void)cpy; return *this; } 113 }; 114 115 /** 116 * An element of type domGlsl_setparam_complexType. 117 */ 118 class domGlsl_setparam : public daeElement, public domGlsl_setparam_complexType 119 { 120 public: 121 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::GLSL_SETPARAM; } 122 static daeInt ID() { return 112; } 123 virtual daeInt typeID() const { return ID(); } 124 125 public: //Accessors and Mutators 126 /** 127 * Gets the ref attribute. 128 * @return Returns a domGlsl_identifier of the ref attribute. 129 */ 130 domGlsl_identifier getRef() const { return attrRef; } 131 /** 132 * Sets the ref attribute. 133 * @param atRef The new value for the ref attribute. 134 */ 135 void setRef( domGlsl_identifier atRef ) { attrRef = atRef; _validAttributeArray[0] = true; } 136 137 /** 138 * Gets the program attribute. 139 * @return Returns a xsNCName of the program attribute. 140 */ 141 xsNCName getProgram() const { return attrProgram; } 142 /** 143 * Sets the program attribute. 144 * @param atProgram The new value for the program attribute. 145 */ 146 void setProgram( xsNCName atProgram ) { *(daeStringRef*)&attrProgram = atProgram; _validAttributeArray[1] = true; } 147 148 protected: 149 /** 150 * Constructor 151 */ 152 domGlsl_setparam(DAE& dae) : daeElement(dae), domGlsl_setparam_complexType(dae, this) {} 153 /** 154 * Destructor 155 */ 156 virtual ~domGlsl_setparam() {} 157 /** 158 * Overloaded assignment operator 159 */ 160 virtual domGlsl_setparam &operator=( const domGlsl_setparam &cpy ) { (void)cpy; return *this; } 161 162 public: // STATIC METHODS 163 /** 164 * Creates an instance of this class and returns a daeElementRef referencing it. 165 * @return a daeElementRef referencing an instance of this object. 166 */ 167 static DLLSPEC daeElementRef create(DAE& dae); 168 /** 169 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 170 * If a daeMetaElement already exists it will return that instead of creating a new one. 171 * @return A daeMetaElement describing this COLLADA element. 172 */ 173 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 174 }; 175 176 177 #endif 178