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 __domCylinder_h__ 10 #define __domCylinder_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 #include <dom/domExtra.h> 17 class DAE; 18 19 /** 20 * A cylinder primitive that is centered on, and aligned with. the local Y 21 * axis. 22 */ 23 class domCylinder : public daeElement 24 { 25 public: 26 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CYLINDER; } 27 static daeInt ID() { return 775; } 28 virtual daeInt typeID() const { return ID(); } 29 public: 30 class domHeight; 31 32 typedef daeSmartRef<domHeight> domHeightRef; 33 typedef daeTArray<domHeightRef> domHeight_Array; 34 35 /** 36 * A float value that represents the length of the cylinder along the Y axis. 37 */ 38 class domHeight : public daeElement 39 { 40 public: 41 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::HEIGHT; } 42 static daeInt ID() { return 776; } 43 virtual daeInt typeID() const { return ID(); } 44 45 protected: // Value 46 /** 47 * The domFloat value of the text data of this element. 48 */ 49 domFloat _value; 50 51 public: //Accessors and Mutators 52 /** 53 * Gets the value of this element. 54 * @return a domFloat of the value. 55 */ 56 domFloat getValue() const { return _value; } 57 /** 58 * Sets the _value of this element. 59 * @param val The new value for this element. 60 */ 61 void setValue( domFloat val ) { _value = val; } 62 63 protected: 64 /** 65 * Constructor 66 */ 67 domHeight(DAE& dae) : daeElement(dae), _value() {} 68 /** 69 * Destructor 70 */ 71 virtual ~domHeight() {} 72 /** 73 * Overloaded assignment operator 74 */ 75 virtual domHeight &operator=( const domHeight &cpy ) { (void)cpy; return *this; } 76 77 public: // STATIC METHODS 78 /** 79 * Creates an instance of this class and returns a daeElementRef referencing it. 80 * @return a daeElementRef referencing an instance of this object. 81 */ 82 static DLLSPEC daeElementRef create(DAE& dae); 83 /** 84 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 85 * If a daeMetaElement already exists it will return that instead of creating a new one. 86 * @return A daeMetaElement describing this COLLADA element. 87 */ 88 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 89 }; 90 91 class domRadius; 92 93 typedef daeSmartRef<domRadius> domRadiusRef; 94 typedef daeTArray<domRadiusRef> domRadius_Array; 95 96 /** 97 * float2 values that represent the radii of the cylinder. 98 */ 99 class domRadius : public daeElement 100 { 101 public: 102 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::RADIUS; } 103 static daeInt ID() { return 777; } 104 virtual daeInt typeID() const { return ID(); } 105 106 protected: // Value 107 /** 108 * The domFloat2 value of the text data of this element. 109 */ 110 domFloat2 _value; 111 112 public: //Accessors and Mutators 113 /** 114 * Gets the _value array. 115 * @return Returns a domFloat2 reference of the _value array. 116 */ 117 domFloat2 &getValue() { return _value; } 118 /** 119 * Gets the _value array. 120 * @return Returns a constant domFloat2 reference of the _value array. 121 */ 122 const domFloat2 &getValue() const { return _value; } 123 /** 124 * Sets the _value array. 125 * @param val The new value for the _value array. 126 */ 127 void setValue( const domFloat2 &val ) { _value = val; } 128 129 protected: 130 /** 131 * Constructor 132 */ 133 domRadius(DAE& dae) : daeElement(dae), _value() {} 134 /** 135 * Destructor 136 */ 137 virtual ~domRadius() {} 138 /** 139 * Overloaded assignment operator 140 */ 141 virtual domRadius &operator=( const domRadius &cpy ) { (void)cpy; return *this; } 142 143 public: // STATIC METHODS 144 /** 145 * Creates an instance of this class and returns a daeElementRef referencing it. 146 * @return a daeElementRef referencing an instance of this object. 147 */ 148 static DLLSPEC daeElementRef create(DAE& dae); 149 /** 150 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 151 * If a daeMetaElement already exists it will return that instead of creating a new one. 152 * @return A daeMetaElement describing this COLLADA element. 153 */ 154 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 155 }; 156 157 158 159 protected: // Elements 160 /** 161 * A float value that represents the length of the cylinder along the Y axis. 162 * @see domHeight 163 */ 164 domHeightRef elemHeight; 165 /** 166 * float2 values that represent the radii of the cylinder. @see domRadius 167 */ 168 domRadiusRef elemRadius; 169 /** 170 * The extra element may appear any number of times. @see domExtra 171 */ 172 domExtra_Array elemExtra_array; 173 174 public: //Accessors and Mutators 175 /** 176 * Gets the height element. 177 * @return a daeSmartRef to the height element. 178 */ 179 const domHeightRef getHeight() const { return elemHeight; } 180 /** 181 * Gets the radius element. 182 * @return a daeSmartRef to the radius element. 183 */ 184 const domRadiusRef getRadius() const { return elemRadius; } 185 /** 186 * Gets the extra element array. 187 * @return Returns a reference to the array of extra elements. 188 */ 189 domExtra_Array &getExtra_array() { return elemExtra_array; } 190 /** 191 * Gets the extra element array. 192 * @return Returns a constant reference to the array of extra elements. 193 */ 194 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 195 protected: 196 /** 197 * Constructor 198 */ 199 domCylinder(DAE& dae) : daeElement(dae), elemHeight(), elemRadius(), elemExtra_array() {} 200 /** 201 * Destructor 202 */ 203 virtual ~domCylinder() {} 204 /** 205 * Overloaded assignment operator 206 */ 207 virtual domCylinder &operator=( const domCylinder &cpy ) { (void)cpy; return *this; } 208 209 public: // STATIC METHODS 210 /** 211 * Creates an instance of this class and returns a daeElementRef referencing it. 212 * @return a daeElementRef referencing an instance of this object. 213 */ 214 static DLLSPEC daeElementRef create(DAE& dae); 215 /** 216 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 217 * If a daeMetaElement already exists it will return that instead of creating a new one. 218 * @return A daeMetaElement describing this COLLADA element. 219 */ 220 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 221 }; 222 223 224 #endif 225