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 __domCapsule_h__ 10 #define __domCapsule_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 capsule primitive that is centered on and aligned with the local Y axis. 21 */ 22 class domCapsule : public daeElement 23 { 24 public: 25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::CAPSULE; } 26 static daeInt ID() { return 782; } 27 virtual daeInt typeID() const { return ID(); } 28 public: 29 class domHeight; 30 31 typedef daeSmartRef<domHeight> domHeightRef; 32 typedef daeTArray<domHeightRef> domHeight_Array; 33 34 /** 35 * A float value that represents the length of the line segment connecting 36 * the centers of the capping hemispheres. 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 783; } 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 * Two float values that represent the radii of the capsule (it may be elliptical) 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 784; } 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 line segment connecting 162 * the centers of the capping hemispheres. @see domHeight 163 */ 164 domHeightRef elemHeight; 165 /** 166 * Two float values that represent the radii of the capsule (it may be elliptical) 167 * @see domRadius 168 */ 169 domRadiusRef elemRadius; 170 /** 171 * The extra element may appear any number of times. @see domExtra 172 */ 173 domExtra_Array elemExtra_array; 174 175 public: //Accessors and Mutators 176 /** 177 * Gets the height element. 178 * @return a daeSmartRef to the height element. 179 */ 180 const domHeightRef getHeight() const { return elemHeight; } 181 /** 182 * Gets the radius element. 183 * @return a daeSmartRef to the radius element. 184 */ 185 const domRadiusRef getRadius() const { return elemRadius; } 186 /** 187 * Gets the extra element array. 188 * @return Returns a reference to the array of extra elements. 189 */ 190 domExtra_Array &getExtra_array() { return elemExtra_array; } 191 /** 192 * Gets the extra element array. 193 * @return Returns a constant reference to the array of extra elements. 194 */ 195 const domExtra_Array &getExtra_array() const { return elemExtra_array; } 196 protected: 197 /** 198 * Constructor 199 */ 200 domCapsule(DAE& dae) : daeElement(dae), elemHeight(), elemRadius(), elemExtra_array() {} 201 /** 202 * Destructor 203 */ 204 virtual ~domCapsule() {} 205 /** 206 * Overloaded assignment operator 207 */ 208 virtual domCapsule &operator=( const domCapsule &cpy ) { (void)cpy; return *this; } 209 210 public: // STATIC METHODS 211 /** 212 * Creates an instance of this class and returns a daeElementRef referencing it. 213 * @return a daeElementRef referencing an instance of this object. 214 */ 215 static DLLSPEC daeElementRef create(DAE& dae); 216 /** 217 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 218 * If a daeMetaElement already exists it will return that instead of creating a new one. 219 * @return A daeMetaElement describing this COLLADA element. 220 */ 221 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 222 }; 223 224 225 #endif 226