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 __domCg_newparam_h__ 10#define __domCg_newparam_h__ 11 12#include <dae/daeDocument.h> 13#include <dom/domTypes.h> 14#include <dom/domElements.h> 15 16#include <dom/domCg_param_type.h> 17#include <dom/domFx_annotate_common.h> 18#include <dom/domCg_setuser_type.h> 19#include <dom/domCg_newarray_type.h> 20class DAE; 21 22/** 23 * Create a new, named param object in the CG Runtime, assign it a type, an 24 * initial value, and additional attributes at declaration time. 25 */ 26class domCg_newparam_complexType 27{ 28public: 29 class domSemantic; 30 31 typedef daeSmartRef<domSemantic> domSemanticRef; 32 typedef daeTArray<domSemanticRef> domSemantic_Array; 33 34/** 35 * The semantic element allows you to specify a semantic for this new param. 36 */ 37 class domSemantic : public daeElement 38 { 39 public: 40 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SEMANTIC; } 41 static daeInt ID() { return 140; } 42 virtual daeInt typeID() const { return ID(); } 43 44 protected: // Value 45 /** 46 * The xsNCName value of the text data of this element. 47 */ 48 xsNCName _value; 49 50 public: //Accessors and Mutators 51 /** 52 * Gets the value of this element. 53 * @return Returns a xsNCName of the value. 54 */ 55 xsNCName getValue() const { return _value; } 56 /** 57 * Sets the _value of this element. 58 * @param val The new value for this element. 59 */ 60 void setValue( xsNCName val ) { *(daeStringRef*)&_value = val; } 61 62 protected: 63 /** 64 * Constructor 65 */ 66 domSemantic(DAE& dae) : daeElement(dae), _value() {} 67 /** 68 * Destructor 69 */ 70 virtual ~domSemantic() {} 71 /** 72 * Overloaded assignment operator 73 */ 74 virtual domSemantic &operator=( const domSemantic &cpy ) { (void)cpy; return *this; } 75 76 public: // STATIC METHODS 77 /** 78 * Creates an instance of this class and returns a daeElementRef referencing it. 79 * @return a daeElementRef referencing an instance of this object. 80 */ 81 static DLLSPEC daeElementRef create(DAE& dae); 82 /** 83 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 84 * If a daeMetaElement already exists it will return that instead of creating a new one. 85 * @return A daeMetaElement describing this COLLADA element. 86 */ 87 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 88 }; 89 90 class domModifier; 91 92 typedef daeSmartRef<domModifier> domModifierRef; 93 typedef daeTArray<domModifierRef> domModifier_Array; 94 95/** 96 * The modifier element allows you to specify a modifier for this new param. 97 */ 98 class domModifier : public daeElement 99 { 100 public: 101 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::MODIFIER; } 102 static daeInt ID() { return 141; } 103 virtual daeInt typeID() const { return ID(); } 104 105 protected: // Value 106 /** 107 * The domFx_modifier_enum_common value of the text data of this element. 108 */ 109 domFx_modifier_enum_common _value; 110 111 public: //Accessors and Mutators 112 /** 113 * Gets the value of this element. 114 * @return a domFx_modifier_enum_common of the value. 115 */ 116 domFx_modifier_enum_common getValue() const { return _value; } 117 /** 118 * Sets the _value of this element. 119 * @param val The new value for this element. 120 */ 121 void setValue( domFx_modifier_enum_common val ) { _value = val; } 122 123 protected: 124 /** 125 * Constructor 126 */ 127 domModifier(DAE& dae) : daeElement(dae), _value() {} 128 /** 129 * Destructor 130 */ 131 virtual ~domModifier() {} 132 /** 133 * Overloaded assignment operator 134 */ 135 virtual domModifier &operator=( const domModifier &cpy ) { (void)cpy; return *this; } 136 137 public: // STATIC METHODS 138 /** 139 * Creates an instance of this class and returns a daeElementRef referencing it. 140 * @return a daeElementRef referencing an instance of this object. 141 */ 142 static DLLSPEC daeElementRef create(DAE& dae); 143 /** 144 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 145 * If a daeMetaElement already exists it will return that instead of creating a new one. 146 * @return A daeMetaElement describing this COLLADA element. 147 */ 148 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 149 }; 150 151 152protected: // Attribute 153 domCg_identifier attrSid; 154 155protected: // Elements 156/** 157 * The annotate element allows you to specify an annotation for this new param. 158 * @see domAnnotate 159 */ 160 domFx_annotate_common_Array elemAnnotate_array; 161/** 162 * The semantic element allows you to specify a semantic for this new param. 163 * @see domSemantic 164 */ 165 domSemanticRef elemSemantic; 166/** 167 * The modifier element allows you to specify a modifier for this new param. 168 * @see domModifier 169 */ 170 domModifierRef elemModifier; 171 domCg_param_typeRef elemCg_param_type; 172 domCg_setuser_typeRef elemUsertype; 173 domCg_newarray_typeRef elemArray; 174 /** 175 * Used to preserve order in elements that do not specify strict sequencing of sub-elements. 176 */ 177 daeElementRefArray _contents; 178 /** 179 * Used to preserve order in elements that have a complex content model. 180 */ 181 daeUIntArray _contentsOrder; 182 183 /** 184 * Used to store information needed for some content model objects. 185 */ 186 daeTArray< daeCharArray * > _CMData; 187 188 189public: //Accessors and Mutators 190 /** 191 * Gets the sid attribute. 192 * @return Returns a domCg_identifier of the sid attribute. 193 */ 194 domCg_identifier getSid() const { return attrSid; } 195 /** 196 * Sets the sid attribute. 197 * @param atSid The new value for the sid attribute. 198 */ 199 void setSid( domCg_identifier atSid ) { attrSid = atSid; } 200 201 /** 202 * Gets the annotate element array. 203 * @return Returns a reference to the array of annotate elements. 204 */ 205 domFx_annotate_common_Array &getAnnotate_array() { return elemAnnotate_array; } 206 /** 207 * Gets the annotate element array. 208 * @return Returns a constant reference to the array of annotate elements. 209 */ 210 const domFx_annotate_common_Array &getAnnotate_array() const { return elemAnnotate_array; } 211 /** 212 * Gets the semantic element. 213 * @return a daeSmartRef to the semantic element. 214 */ 215 const domSemanticRef getSemantic() const { return elemSemantic; } 216 /** 217 * Gets the modifier element. 218 * @return a daeSmartRef to the modifier element. 219 */ 220 const domModifierRef getModifier() const { return elemModifier; } 221 /** 222 * Gets the cg_param_type element. 223 * @return a daeSmartRef to the cg_param_type element. 224 */ 225 const domCg_param_typeRef getCg_param_type() const { return elemCg_param_type; } 226 /** 227 * Gets the usertype element. 228 * @return a daeSmartRef to the usertype element. 229 */ 230 const domCg_setuser_typeRef getUsertype() const { return elemUsertype; } 231 /** 232 * Gets the array element. 233 * @return a daeSmartRef to the array element. 234 */ 235 const domCg_newarray_typeRef getArray() const { return elemArray; } 236 /** 237 * Gets the _contents array. 238 * @return Returns a reference to the _contents element array. 239 */ 240 daeElementRefArray &getContents() { return _contents; } 241 /** 242 * Gets the _contents array. 243 * @return Returns a constant reference to the _contents element array. 244 */ 245 const daeElementRefArray &getContents() const { return _contents; } 246 247protected: 248 /** 249 * Constructor 250 */ 251 domCg_newparam_complexType(DAE& dae, daeElement* elt) : attrSid(), elemAnnotate_array(), elemSemantic(), elemModifier(), elemCg_param_type(), elemUsertype(), elemArray() {} 252 /** 253 * Destructor 254 */ 255 virtual ~domCg_newparam_complexType() { daeElement::deleteCMDataArray(_CMData); } 256 /** 257 * Overloaded assignment operator 258 */ 259 virtual domCg_newparam_complexType &operator=( const domCg_newparam_complexType &cpy ) { (void)cpy; return *this; } 260}; 261 262/** 263 * An element of type domCg_newparam_complexType. 264 */ 265class domCg_newparam : public daeElement, public domCg_newparam_complexType 266{ 267public: 268 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CG_NEWPARAM; } 269 static daeInt ID() { return 142; } 270 virtual daeInt typeID() const { return ID(); } 271 272public: //Accessors and Mutators 273 /** 274 * Gets the sid attribute. 275 * @return Returns a domCg_identifier of the sid attribute. 276 */ 277 domCg_identifier getSid() const { return attrSid; } 278 /** 279 * Sets the sid attribute. 280 * @param atSid The new value for the sid attribute. 281 */ 282 void setSid( domCg_identifier atSid ) { attrSid = atSid; _validAttributeArray[0] = true; } 283 284protected: 285 /** 286 * Constructor 287 */ 288 domCg_newparam(DAE& dae) : daeElement(dae), domCg_newparam_complexType(dae, this) {} 289 /** 290 * Destructor 291 */ 292 virtual ~domCg_newparam() {} 293 /** 294 * Overloaded assignment operator 295 */ 296 virtual domCg_newparam &operator=( const domCg_newparam &cpy ) { (void)cpy; return *this; } 297 298public: // STATIC METHODS 299 /** 300 * Creates an instance of this class and returns a daeElementRef referencing it. 301 * @return a daeElementRef referencing an instance of this object. 302 */ 303 static DLLSPEC daeElementRef create(DAE& dae); 304 /** 305 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 306 * If a daeMetaElement already exists it will return that instead of creating a new one. 307 * @return A daeMetaElement describing this COLLADA element. 308 */ 309 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 310}; 311 312 313#endif 314