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