2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 /// Three dimensional size
24 public class Size : global::System.IDisposable
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 protected bool swigCMemOwn;
29 internal Size(global::System.IntPtr cPtr, bool cMemoryOwn)
31 swigCMemOwn = cMemoryOwn;
32 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
35 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj)
37 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 DisposeQueue.Instance.Add(this);
47 public virtual void Dispose()
49 if (!Stage.IsInstalled())
51 DisposeQueue.Instance.Add(this);
57 if (swigCPtr.Handle != global::System.IntPtr.Zero)
62 NDalicPINVOKE.delete_Vector3(swigCPtr);
64 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
66 global::System.GC.SuppressFinalize(this);
72 /// Addition operator.
74 public static Size operator +(Size arg1, Size arg2)
76 return arg1.Add(arg2);
80 /// Subtraction operator.
82 public static Size operator -(Size arg1, Size arg2)
84 return arg1.Subtract(arg2);
90 public static Size operator -(Size arg1)
92 return arg1.Subtract();
96 /// Multiplication operator.
98 public static Size operator *(Size arg1, Size arg2)
100 return arg1.Multiply(arg2);
104 /// Multiplication operator.
106 public static Size operator *(Size arg1, float arg2)
108 return arg1.Multiply(arg2);
112 /// Division operator.
114 public static Size operator /(Size arg1, Size arg2)
116 return arg1.Divide(arg2);
120 /// Division operator.
122 public static Size operator /(Size arg1, float arg2)
124 return arg1.Divide(arg2);
128 /// Array subscript operator.
130 public float this[uint index]
134 return ValueOfIndex(index);
140 public static Size GetSizeFromPtr(global::System.IntPtr cPtr)
142 Size ret = new Size(cPtr, false);
143 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true)
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true)
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true)
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 public static Size Zero
177 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
178 Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 private Size Add(Size rhs)
186 Size ret = new Size(NDalicPINVOKE.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 private Size Subtract(Size rhs)
193 Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 private Size Multiply(Size rhs)
200 Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 private Size Multiply(float rhs)
207 Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 private Size Divide(Size rhs)
214 Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true);
215 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 private Size Divide(float rhs)
221 Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 private Size Subtract()
228 Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
229 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233 private float ValueOfIndex(uint index)
235 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 /// Utilizes appropriate machine epsilon values.
244 public bool EqualTo(Size rhs)
246 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Size.getCPtr(rhs));
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 /// Check inequality.
253 /// Utilizes appropriate machine epsilon values.
255 public bool NotEqualTo(Size rhs)
257 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Size.getCPtr(rhs));
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
268 NDalicPINVOKE.Vector3_Width_set(swigCPtr, value);
269 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
273 float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr);
274 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
285 NDalicPINVOKE.Vector3_Height_set(swigCPtr, value);
286 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
290 float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307 float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr);
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 public static implicit operator Vector3(Size size)
317 return new Vector3(size.Width, size.Height, size.Depth);
322 public static implicit operator Size(Vector3 vec)
324 return new Size(vec.Width, vec.Height, vec.Depth);