14 * @param [in] a Width value .
15 * @param [in] b Height value.
17 public Size(float a, float b)
23 * @brief default constructor
34 * @brief constructor with base class object
37 * @param [in] o The Vector2 with Width, Height values.
39 public Size(Vector2 o)
46 * @brief Copy constructor
49 * @param [in] o The Size having Width & Y.
57 ///< name "W", type float (Size Width value)
62 set { width = value; }
65 ///< name "H", type float (Size Height value)
69 get { return height; }
70 set { height = value; }
76 set { width = value; }
81 get { return height; }
82 set { height = value; }
89 * @param [in] l The Size to add.
90 * @param [in] r The Size to add
91 * @return A reference to this
93 public static Size operator +(Size l, Size r)
95 return new Size(l.W + r.W, l.H + r.H);
102 * @param [in] l The Size to substract.
103 * @param [in] r The Size to substract
104 * @return A reference to this
106 public static Size operator -(Size l, Size r)
108 return new Size(l.W - r.W, l.H - r.H);
115 * @param [in] a The Size to multiply
116 * @param [in] b The constant to multiply of type double.
117 * @return A reference to this
119 public static Size operator *(Size a, double b)
121 return new Size((float)(a.W * b), (float)(a.H * b));
128 * @param [in] a The Size to divide.
129 * @param [in] b The Size to divide
130 * @return float of the size division
132 public static float operator /(Size a, Size b)
134 return (float)System.Math.Sqrt((a.W / b.W) * (a.H / b.H));
141 * @param [in] a The Size object to compare.
142 * @param [in] b The Size object to compare.
143 * @return bool, whether Size are equal or not
145 public static bool operator == (Size a, Size b)
147 return a.W == b.W && a.H == b.H ;
154 * @param [in] a The Size object to compare.
155 * @param [in] b The Size object to compare.
156 * @return bool, whether Size are equal or not
158 public static bool operator != (Size a, Size b)
160 return a.W != b.W || a.H != b.H;
167 * @return int, hascode of Size
169 public override int GetHashCode()
178 * @return returns a copy of Size object
182 Size copy = new Size(W, H);
186 // User-defined conversion from Position to Vector2
187 public static implicit operator Vector2(Size size)
189 return new Vector2(size.width, size.height);
192 public static implicit operator Size(Vector2 vec)
194 return new Size(vec.X, vec.Y);
201 private float height;
204 public Size3D(float a, float b, float c)
218 public Size3D(Vector3 o)
225 public Size3D(Vector2 o)
232 public Size3D(Size3D a)
241 get { return width; }
242 set { width = value; }
247 get { return height; }
248 set { height = value; }
253 get { return depth; }
254 set { depth = value; }
259 get { return width; }
260 set { width = value; }
265 get { return height; }
266 set { height = value; }
271 get { return depth; }
272 set { depth = value; }
277 get { return width; }
278 set { width = value; }
283 get { return height; }
284 set { height = value; }
289 get { return depth; }
290 set { depth = value; }
293 // User-defined conversion from Position to Vector3
294 public static implicit operator Vector3(Size3D size)
296 return new Vector3(size.width, size.height, size.depth);
299 public static implicit operator Size3D(Vector3 vec)
301 return new Size3D(vec.X, vec.Y, vec.Z);