Home | History | Annotate | Download | only in dom
      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 __domSphere_h__
     10 #define __domSphere_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 centered sphere primitive.
     21  */
     22 class domSphere : public daeElement
     23 {
     24 public:
     25 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SPHERE; }
     26 	static daeInt ID() { return 771; }
     27 	virtual daeInt typeID() const { return ID(); }
     28 public:
     29 	class domRadius;
     30 
     31 	typedef daeSmartRef<domRadius> domRadiusRef;
     32 	typedef daeTArray<domRadiusRef> domRadius_Array;
     33 
     34 /**
     35  * A float value that represents the radius of the sphere
     36  */
     37 	class domRadius : public daeElement
     38 	{
     39 	public:
     40 		virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::RADIUS; }
     41 		static daeInt ID() { return 772; }
     42 		virtual daeInt typeID() const { return ID(); }
     43 
     44 	protected:  // Value
     45 		/**
     46 		 * The domFloat value of the text data of this element.
     47 		 */
     48 		domFloat _value;
     49 
     50 	public:	//Accessors and Mutators
     51 		/**
     52 		 * Gets the value of this element.
     53 		 * @return a domFloat of the value.
     54 		 */
     55 		domFloat 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( domFloat val ) { _value = val; }
     61 
     62 	protected:
     63 		/**
     64 		 * Constructor
     65 		 */
     66 		domRadius(DAE& dae) : daeElement(dae), _value() {}
     67 		/**
     68 		 * Destructor
     69 		 */
     70 		virtual ~domRadius() {}
     71 		/**
     72 		 * Overloaded assignment operator
     73 		 */
     74 		virtual domRadius &operator=( const domRadius &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 
     91 
     92 protected:  // Elements
     93 /**
     94  * A float value that represents the radius of the sphere @see domRadius
     95  */
     96 	domRadiusRef elemRadius;
     97 /**
     98  *  The extra element may appear any number of times.  @see domExtra
     99  */
    100 	domExtra_Array elemExtra_array;
    101 
    102 public:	//Accessors and Mutators
    103 	/**
    104 	 * Gets the radius element.
    105 	 * @return a daeSmartRef to the radius element.
    106 	 */
    107 	const domRadiusRef getRadius() const { return elemRadius; }
    108 	/**
    109 	 * Gets the extra element array.
    110 	 * @return Returns a reference to the array of extra elements.
    111 	 */
    112 	domExtra_Array &getExtra_array() { return elemExtra_array; }
    113 	/**
    114 	 * Gets the extra element array.
    115 	 * @return Returns a constant reference to the array of extra elements.
    116 	 */
    117 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
    118 protected:
    119 	/**
    120 	 * Constructor
    121 	 */
    122 	domSphere(DAE& dae) : daeElement(dae), elemRadius(), elemExtra_array() {}
    123 	/**
    124 	 * Destructor
    125 	 */
    126 	virtual ~domSphere() {}
    127 	/**
    128 	 * Overloaded assignment operator
    129 	 */
    130 	virtual domSphere &operator=( const domSphere &cpy ) { (void)cpy; return *this; }
    131 
    132 public: // STATIC METHODS
    133 	/**
    134 	 * Creates an instance of this class and returns a daeElementRef referencing it.
    135 	 * @return a daeElementRef referencing an instance of this object.
    136 	 */
    137 	static DLLSPEC daeElementRef create(DAE& dae);
    138 	/**
    139 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
    140 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
    141 	 * @return A daeMetaElement describing this COLLADA element.
    142 	 */
    143 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
    144 };
    145 
    146 
    147 #endif
    148