• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __domBox_h__
10 #define __domBox_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  * An axis-aligned, centered box primitive.
21  */
22 class domBox : public daeElement
23 {
24 public:
getElementType()25 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::BOX; }
ID()26 	static daeInt ID() { return 767; }
typeID()27 	virtual daeInt typeID() const { return ID(); }
28 public:
29 	class domHalf_extents;
30 
31 	typedef daeSmartRef<domHalf_extents> domHalf_extentsRef;
32 	typedef daeTArray<domHalf_extentsRef> domHalf_extents_Array;
33 
34 /**
35  * 3 float values that represent the extents of the box
36  */
37 	class domHalf_extents : public daeElement
38 	{
39 	public:
getElementType()40 		virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::HALF_EXTENTS; }
ID()41 		static daeInt ID() { return 768; }
typeID()42 		virtual daeInt typeID() const { return ID(); }
43 
44 	protected:  // Value
45 		/**
46 		 * The domFloat3 value of the text data of this element.
47 		 */
48 		domFloat3 _value;
49 
50 	public:	//Accessors and Mutators
51 		/**
52 		 * Gets the _value array.
53 		 * @return Returns a domFloat3 reference of the _value array.
54 		 */
getValue()55 		domFloat3 &getValue() { return _value; }
56 		/**
57 		 * Gets the _value array.
58 		 * @return Returns a constant domFloat3 reference of the _value array.
59 		 */
getValue()60 		const domFloat3 &getValue() const { return _value; }
61 		/**
62 		 * Sets the _value array.
63 		 * @param val The new value for the _value array.
64 		 */
setValue(const domFloat3 & val)65 		void setValue( const domFloat3 &val ) { _value = val; }
66 
67 	protected:
68 		/**
69 		 * Constructor
70 		 */
domHalf_extents(DAE & dae)71 		domHalf_extents(DAE& dae) : daeElement(dae), _value() {}
72 		/**
73 		 * Destructor
74 		 */
~domHalf_extents()75 		virtual ~domHalf_extents() {}
76 		/**
77 		 * Overloaded assignment operator
78 		 */
79 		virtual domHalf_extents &operator=( const domHalf_extents &cpy ) { (void)cpy; return *this; }
80 
81 	public: // STATIC METHODS
82 		/**
83 		 * Creates an instance of this class and returns a daeElementRef referencing it.
84 		 * @return a daeElementRef referencing an instance of this object.
85 		 */
86 		static DLLSPEC daeElementRef create(DAE& dae);
87 		/**
88 		 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
89 		 * If a daeMetaElement already exists it will return that instead of creating a new one.
90 		 * @return A daeMetaElement describing this COLLADA element.
91 		 */
92 		static DLLSPEC daeMetaElement* registerElement(DAE& dae);
93 	};
94 
95 
96 
97 protected:  // Elements
98 /**
99  * 3 float values that represent the extents of the box @see domHalf_extents
100  */
101 	domHalf_extentsRef elemHalf_extents;
102 /**
103  *  The extra element may appear any number of times.  @see domExtra
104  */
105 	domExtra_Array elemExtra_array;
106 
107 public:	//Accessors and Mutators
108 	/**
109 	 * Gets the half_extents element.
110 	 * @return a daeSmartRef to the half_extents element.
111 	 */
getHalf_extents()112 	const domHalf_extentsRef getHalf_extents() const { return elemHalf_extents; }
113 	/**
114 	 * Gets the extra element array.
115 	 * @return Returns a reference to the array of extra elements.
116 	 */
getExtra_array()117 	domExtra_Array &getExtra_array() { return elemExtra_array; }
118 	/**
119 	 * Gets the extra element array.
120 	 * @return Returns a constant reference to the array of extra elements.
121 	 */
getExtra_array()122 	const domExtra_Array &getExtra_array() const { return elemExtra_array; }
123 protected:
124 	/**
125 	 * Constructor
126 	 */
domBox(DAE & dae)127 	domBox(DAE& dae) : daeElement(dae), elemHalf_extents(), elemExtra_array() {}
128 	/**
129 	 * Destructor
130 	 */
~domBox()131 	virtual ~domBox() {}
132 	/**
133 	 * Overloaded assignment operator
134 	 */
135 	virtual domBox &operator=( const domBox &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 
152 #endif
153