2 * Copyright (c) 2019 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.
18 using System.ComponentModel;
19 using Tizen.NUI.Binding;
24 /// RelativeVector3 is a three-dimensional vector.
25 /// All values (x, y, z and w) should be between [0, 1].
27 /// <since_tizen> 3 </since_tizen>
28 [Binding.TypeConverter(typeof(RelativeVector3TypeConverter))]
29 public class RelativeVector3 : Disposable
35 /// <since_tizen> 3 </since_tizen>
36 public RelativeVector3() : this(Interop.Vector3.new_Vector3__SWIG_0(), true)
38 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44 /// <param name="x">The x component.</param>
45 /// <param name="y">The y component.</param>
46 /// <param name="z">The z component.</param>
47 /// <since_tizen> 3 </since_tizen>
48 public RelativeVector3(float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
50 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56 /// <param name="relativeVector2">The RelativeVector2 to create this vector from.</param>
57 /// <since_tizen> 3 </since_tizen>
58 public RelativeVector3(RelativeVector2 relativeVector2) : this(Interop.Vector3.new_Vector3__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true)
60 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
66 /// <param name="relativeVector4">The RelativeVector4 to create this vector from.</param>
67 /// <since_tizen> 3 </since_tizen>
68 public RelativeVector3(RelativeVector4 relativeVector4) : this(Interop.Vector3.new_Vector3__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true)
70 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 /// <since_tizen> 3 </since_tizen>
77 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor")]
82 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor");
84 Interop.Vector3.Vector3_X_set(swigCPtr, value);
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 float ret = Interop.Vector3.Vector3_X_get(swigCPtr);
90 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98 /// <since_tizen> 3 </since_tizen>
99 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor")]
104 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor");
106 Interop.Vector3.Vector3_Y_set(swigCPtr, value);
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 float ret = Interop.Vector3.Vector3_Y_get(swigCPtr);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 /// <since_tizen> 3 </since_tizen>
121 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor")]
126 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new RelativeVector3(...) constructor");
128 Interop.Vector3.Vector3_Z_set(swigCPtr, value);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 float ret = Interop.Vector3.Vector3_Z_get(swigCPtr);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 /// The addition operator.
142 /// <param name="arg1">The vector to add.</param>
143 /// <param name="arg2">Th vector to add.</param>
144 /// <returns>The vector containing the result of the addition.</returns>
145 /// <since_tizen> 3 </since_tizen>
146 public static RelativeVector3 operator +(RelativeVector3 arg1, RelativeVector3 arg2)
148 RelativeVector3 result = arg1.Add(arg2);
153 /// The subtraction operator.
155 /// <param name="arg1">The vector to subtract.</param>
156 /// <param name="arg2">The vector to subtract.</param>
157 /// <returns>The vector containing the result of the subtraction.</returns>
158 /// <since_tizen> 3 </since_tizen>
159 public static RelativeVector3 operator -(RelativeVector3 arg1, RelativeVector3 arg2)
161 RelativeVector3 result = arg1.Subtract(arg2);
166 /// The multiplication operator.
168 /// <param name="arg1">The vector to multiply.</param>
169 /// <param name="arg2">The vector to multiply.</param>
170 /// <returns>The vector containing the result of the multiplication.</returns>
171 /// <since_tizen> 3 </since_tizen>
172 public static RelativeVector3 operator *(RelativeVector3 arg1, RelativeVector3 arg2)
174 RelativeVector3 result = arg1.Multiply(arg2);
179 /// The multiplication operator.
181 /// <param name="arg1">The vector to multiply.</param>
182 /// <param name="arg2">The float value to scale the vector.</param>
183 /// <returns>The vector containing the result of the scaling.</returns>
184 /// <since_tizen> 3 </since_tizen>
185 public static RelativeVector3 operator *(RelativeVector3 arg1, float arg2)
187 RelativeVector3 result = arg1.Multiply(arg2);
192 /// The division operator.
194 /// <param name="arg1">The vector to divide.</param>
195 /// <param name="arg2">The vector to divide.</param>
196 /// <returns>The vector containing the result of the division.</returns>
197 /// <since_tizen> 3 </since_tizen>
198 public static RelativeVector3 operator /(RelativeVector3 arg1, RelativeVector3 arg2)
200 RelativeVector3 result = arg1.Divide(arg2);
205 /// The division operator.
207 /// <param name="arg1">The vector to divide.</param>
208 /// <param name="arg2">The float value to scale the vector by.</param>
209 /// <returns>The vector containing the result of the scaling.</returns>
210 /// <since_tizen> 3 </since_tizen>
211 public static RelativeVector3 operator /(RelativeVector3 arg1, float arg2)
213 RelativeVector3 result = arg1.Divide(arg2);
219 /// <since_tizen> 3 </since_tizen>
220 public static implicit operator Vector3(RelativeVector3 relativeVector3)
222 return new Vector3(relativeVector3.X, relativeVector3.Y, relativeVector3.Z);
227 /// <since_tizen> 3 </since_tizen>
228 public static implicit operator RelativeVector3(Vector3 vec)
230 return new RelativeVector3(vec.X, vec.Y, vec.Z);
234 /// The const array subscript operator overload. Should be 0, 1 or 2.
236 /// <param name="index">The subscript index.</param>
237 /// <returns>The float at the given index.</returns>
238 /// <since_tizen> 3 </since_tizen>
239 public float this[uint index]
243 return ValueOfIndex(index);
248 /// Determines whether the specified object is equal to the current object.
250 /// <param name="obj">The object to compare with the current object.</param>
251 /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
252 public override bool Equals(System.Object obj)
254 RelativeVector3 relativeVector3 = obj as RelativeVector3;
256 if (X == relativeVector3?.X && Y == relativeVector3?.Y && Z == relativeVector3?.Z)
264 /// Gets the the hash code of this RelativeVector3.
266 /// <returns>The Hash Code.</returns>
267 /// <since_tizen> 6 </since_tizen>
268 public override int GetHashCode()
270 return swigCPtr.Handle.GetHashCode();
274 /// Compares if the rhs is equal to.
276 /// <param name="rhs">The vector to compare.</param>
277 /// <returns>Returns true if the two vectors are equal, otherwise false.</returns>
278 /// <since_tizen> 3 </since_tizen>
279 public bool EqualTo(RelativeVector3 rhs)
281 bool ret = Interop.Vector3.Vector3_EqualTo(swigCPtr, RelativeVector3.getCPtr(rhs));
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 /// Compares if the rhs is not equal to.
289 /// <param name="rhs">The vector to compare.</param>
290 /// <returns>Returns true if the two vectors are not equal, otherwise false.</returns>
291 /// <since_tizen> 3 </since_tizen>
292 public bool NotEqualTo(RelativeVector3 rhs)
294 bool ret = Interop.Vector3.Vector3_NotEqualTo(swigCPtr, RelativeVector3.getCPtr(rhs));
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 internal static RelativeVector3 GetRelativeVector3FromPtr(global::System.IntPtr cPtr)
303 RelativeVector3 ret = new RelativeVector3(cPtr, false);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector3 obj)
310 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
313 internal RelativeVector3(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
317 /// This will not be public opened.
318 [EditorBrowsable(EditorBrowsableState.Never)]
319 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
321 Interop.Vector3.delete_Vector3(swigCPtr);
324 private RelativeVector3 Add(RelativeVector3 rhs)
326 RelativeVector3 ret = new RelativeVector3(Interop.Vector3.Vector3_Add(swigCPtr, RelativeVector3.getCPtr(rhs)), true);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 private RelativeVector3 Subtract(RelativeVector3 rhs)
333 RelativeVector3 ret = new RelativeVector3(Interop.Vector3.Vector3_Subtract__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true);
334 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 private RelativeVector3 Multiply(RelativeVector3 rhs)
340 RelativeVector3 ret = new RelativeVector3(Interop.Vector3.Vector3_Multiply__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true);
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
345 private RelativeVector3 Multiply(float rhs)
347 RelativeVector3 ret = new RelativeVector3(Interop.Vector3.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
348 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 private RelativeVector3 Divide(RelativeVector3 rhs)
354 RelativeVector3 ret = new RelativeVector3(Interop.Vector3.Vector3_Divide__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 private RelativeVector3 Divide(float rhs)
361 RelativeVector3 ret = new RelativeVector3(Interop.Vector3.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
362 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 private float ValueOfIndex(uint index)
368 float ret = Interop.Vector3.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
369 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();