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.
19 using Tizen.NUI.Binding;
20 using System.ComponentModel;
26 /// Position is a three-dimensional vector.
28 /// <since_tizen> 3 </since_tizen>
29 [Tizen.NUI.Binding.TypeConverter(typeof(PositionTypeConverter))]
30 public class Position : Disposable, ICloneable
37 /// Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting. <br />
38 /// For example, the followings are possible. <br />
39 /// view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost. <br />
40 /// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
42 /// <since_tizen> 3 </since_tizen>
43 public Position() : this(Interop.Vector3.new_Vector3__SWIG_0(), true)
45 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51 /// <param name="x">The x component.</param>
52 /// <param name="y">The y component.</param>
53 /// <param name="z">The z component(optional).</param>
55 /// Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting. <br />
56 /// For example, the followings are possible. <br />
57 /// view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost. <br />
58 /// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default. <br />
60 /// <since_tizen> 3 </since_tizen>
61 public Position(float x, float y, float z = 0.0f) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
63 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
69 /// <param name="position2d">Position2D to create this vector from.</param>
70 /// <since_tizen> 3 </since_tizen>
71 public Position(Position2D position2d) : this(Interop.Vector3.new_Vector3__SWIG_3(Position2D.getCPtr(position2d)), true)
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 internal Position(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
81 /// ParentOrigin constants. It's 0.0.
83 /// <since_tizen> 3 </since_tizen>
84 public static float ParentOriginTop
88 float ret = Interop.NDalicParentOrigin.ParentOriginTop_get();
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 /// ParentOrigin constants. It's 1.0.
97 /// <since_tizen> 3 </since_tizen>
98 public static float ParentOriginBottom
102 float ret = Interop.NDalicParentOrigin.ParentOriginBottom_get();
103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 /// ParentOrigin constants. It's 0.0.
111 /// <since_tizen> 3 </since_tizen>
112 public static float ParentOriginLeft
116 float ret = Interop.NDalicParentOrigin.ParentOriginLeft_get();
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 /// ParentOrigin constants. It's 1.0.
125 /// <since_tizen> 3 </since_tizen>
126 public static float ParentOriginRight
130 float ret = Interop.NDalicParentOrigin.ParentOriginRight_get();
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 /// ParentOrigin constants. It's 0.5.
139 /// <since_tizen> 3 </since_tizen>
140 public static float ParentOriginMiddle
144 float ret = Interop.NDalicParentOrigin.ParentOriginMiddle_get();
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 /// ParentOrigin constants: 0.0, 0.0, 0.5.
153 /// <since_tizen> 3 </since_tizen>
154 public static Position ParentOriginTopLeft
158 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopLeft_get();
159 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 /// ParentOrigin constants: 0.5, 0.0, 0.5.
168 /// <since_tizen> 3 </since_tizen>
169 public static Position ParentOriginTopCenter
173 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopCenter_get();
174 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 /// ParentOrigin constants: 1.0, 0.0, 0.5.
183 /// <since_tizen> 3 </since_tizen>
184 public static Position ParentOriginTopRight
188 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopRight_get();
189 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 /// ParentOrigin constants: 0.0, 0.5, 0.5.
198 /// <since_tizen> 3 </since_tizen>
199 public static Position ParentOriginCenterLeft
203 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterLeft_get();
204 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// ParentOrigin constants: 0.0, 0.5, 0.5
213 /// <since_tizen> 3 </since_tizen>
214 public static Position ParentOriginCenter
218 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenter_get();
219 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// ParentOrigin constants: 1.0, 0.5, 0.5.
228 /// <since_tizen> 3 </since_tizen>
229 public static Position ParentOriginCenterRight
233 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterRight_get();
234 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 /// ParentOrigin constants: 0.0f, 1.0f, 0.5f.
243 /// <since_tizen> 3 </since_tizen>
244 public static Position ParentOriginBottomLeft
248 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomLeft_get();
249 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
256 /// ParentOrigin constants: 0.5, 1.0, 0.5.
258 /// <since_tizen> 3 </since_tizen>
259 public static Position ParentOriginBottomCenter
263 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomCenter_get();
264 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// ParentOrigin constants: 1.0, 1.0, 0.5.
273 /// <since_tizen> 3 </since_tizen>
274 public static Position ParentOriginBottomRight
278 global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomRight_get();
279 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 /// PivotPoint constants: 0.0.
288 /// <since_tizen> 3 </since_tizen>
289 public static float PivotPointTop
293 float ret = Interop.NDalicAnchorPoint.AnchorPointTop_get();
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 /// PivotPoint constants: 1.0.
302 /// <since_tizen> 3 </since_tizen>
303 public static float PivotPointBottom
307 float ret = Interop.NDalicAnchorPoint.AnchorPointBottom_get();
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 /// PivotPoint constants: 0.0.
316 /// <since_tizen> 3 </since_tizen>
317 public static float PivotPointLeft
321 float ret = Interop.NDalicAnchorPoint.AnchorPointLeft_get();
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328 /// PivotPoint constants: 1.0.
330 /// <since_tizen> 3 </since_tizen>
331 public static float PivotPointRight
335 float ret = Interop.NDalicAnchorPoint.AnchorPointRight_get();
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342 /// PivotPoint constants: 0.0.
344 /// <since_tizen> 3 </since_tizen>
345 public static float PivotPointMiddle
349 float ret = Interop.NDalicAnchorPoint.AnchorPointMiddle_get();
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 /// PivotPoint constants: 0.0, 0.0, 0.5.
358 /// <since_tizen> 3 </since_tizen>
359 public static Position PivotPointTopLeft
363 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopLeft_get();
364 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 /// PivotPoint constants: 0.5, 0.0, 0.5.
373 /// <since_tizen> 3 </since_tizen>
374 public static Position PivotPointTopCenter
378 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopCenter_get();
379 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 /// PivotPoint constants: 1.0, 0.0, 0.5.
388 /// <since_tizen> 3 </since_tizen>
389 public static Position PivotPointTopRight
393 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopRight_get();
394 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 /// PivotPoint constants: 0.0, 0.5, 0.5.
403 /// <since_tizen> 3 </since_tizen>
404 public static Position PivotPointCenterLeft
408 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterLeft_get();
409 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416 /// PivotPoint constants: 0.5, 0.5, 0.5.
418 /// <since_tizen> 3 </since_tizen>
419 public static Position PivotPointCenter
423 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenter_get();
424 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 /// PivotPoint constants: 1.0, 0.5, 0.5.
433 /// <since_tizen> 3 </since_tizen>
434 public static Position PivotPointCenterRight
438 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterRight_get();
439 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 /// PivotPoint constants: 0.0, 1.0, 0.5.
448 /// <since_tizen> 3 </since_tizen>
449 public static Position PivotPointBottomLeft
453 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomLeft_get();
454 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
461 /// PivotPoint constants: 0.5, 1.0, 0.5
463 /// <since_tizen> 3 </since_tizen>
464 public static Position PivotPointBottomCenter
468 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomCenter_get();
469 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 /// PivotPoint constants: 1.0, 1.0, 0.5.
478 /// <since_tizen> 3 </since_tizen>
479 public static Position PivotPointBottomRight
483 global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomRight_get();
484 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
485 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
491 /// Constant ( 1.0f, 1.0f, 1.0f ).
493 /// <since_tizen> 3 </since_tizen>
494 public static Position One
498 global::System.IntPtr cPtr = Interop.Vector3.Vector3_ONE_get();
499 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
500 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
506 /// Constant ( 0.0f, 0.0f, 0.0f ).
508 /// <since_tizen> 3 </since_tizen>
509 public static Position Zero
513 global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZERO_get();
514 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523 /// <since_tizen> 3 </since_tizen>
524 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
529 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor");
531 Interop.Vector3.Vector3_X_set(swigCPtr, value);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
534 callback?.Invoke(X, Y, Z);
538 float ret = Interop.Vector3.Vector3_X_get(swigCPtr);
539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
547 /// <since_tizen> 3 </since_tizen>
548 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
553 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor");
555 Interop.Vector3.Vector3_Y_set(swigCPtr, value);
556 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
558 callback?.Invoke(X, Y, Z);
562 float ret = Interop.Vector3.Vector3_Y_get(swigCPtr);
563 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
571 /// <since_tizen> 3 </since_tizen>
572 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
577 Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor");
579 Interop.Vector3.Vector3_Z_set(swigCPtr, value);
580 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
582 callback?.Invoke(X, Y, Z);
586 float ret = Interop.Vector3.Vector3_Z_get(swigCPtr);
587 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592 internal static Position XAxis
596 global::System.IntPtr cPtr = Interop.Vector3.Vector3_XAXIS_get();
597 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
598 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
603 internal static Position YAxis
607 global::System.IntPtr cPtr = Interop.Vector3.Vector3_YAXIS_get();
608 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 internal static Position ZAxis
618 global::System.IntPtr cPtr = Interop.Vector3.Vector3_ZAXIS_get();
619 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
620 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
625 internal static Position NegativeXAxis
629 global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_XAXIS_get();
630 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
631 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 internal static Position NegativeYAxis
640 global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_YAXIS_get();
641 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
642 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647 internal static Position NegativeZAxis
651 global::System.IntPtr cPtr = Interop.Vector3.Vector3_NEGATIVE_ZAXIS_get();
652 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
653 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659 /// The const array subscript operator overload. Should be 0, 1, or 2.
661 /// <param name="index">The subscript index.</param>
662 /// <returns>The float at the given index.</returns>
663 /// <since_tizen> 3 </since_tizen>
664 public float this[uint index]
668 return ValueOfIndex(index);
674 /// An addition operator.
676 /// <param name="arg1">The vector to add.</param>
677 /// <param name="arg2">The vector to add.</param>
678 /// <returns>The vector containing the result of the addition.</returns>
679 /// <since_tizen> 3 </since_tizen>
680 public static Position operator +(Position arg1, Position arg2)
682 return arg1?.Add(arg2);
686 /// The subtraction operator.
688 /// <param name="arg1">The vector to subtract.</param>
689 /// <param name="arg2">The vector to subtract.</param>
690 /// <returns>The vector containing the result of the subtraction.</returns>
691 /// <since_tizen> 3 </since_tizen>
692 public static Position operator -(Position arg1, Position arg2)
694 return arg1?.Subtract(arg2);
698 /// The unary negation operator.
700 /// <param name="arg1">The vector to negate.</param>
701 /// <returns>The vector containg the negation.</returns>
702 /// <since_tizen> 3 </since_tizen>
703 public static Position operator -(Position arg1)
705 return arg1?.Subtract();
709 /// The multiplication operator.
711 /// <param name="arg1">The vector to multiply.</param>
712 /// <param name="arg2">The vector to multiply.</param>
713 /// <returns>The vector containing the result of the multiplication.</returns>
714 /// <since_tizen> 3 </since_tizen>
715 public static Position operator *(Position arg1, Position arg2)
717 return arg1?.Multiply(arg2);
721 /// The multiplication operator.
723 /// <param name="arg1">The vector to multiply</param>
724 /// <param name="arg2">The float value to scale the vector.</param>
725 /// <returns>The vector containing the result of scaling.</returns>
726 /// <since_tizen> 3 </since_tizen>
727 public static Position operator *(Position arg1, float arg2)
729 return arg1?.Multiply(arg2);
733 /// The division operator.
735 /// <param name="arg1">The vector to divide.</param>
736 /// <param name="arg2">The vector to divide.</param>
737 /// <returns>The vector containing the result of the division.</returns>
738 /// <since_tizen> 3 </since_tizen>
739 public static Position operator /(Position arg1, Position arg2)
741 return arg1?.Divide(arg2);
745 /// The division operator.
747 /// <param name="arg1">The vector to divide.</param>
748 /// <param name="arg2">The float value to scale the vector by.</param>
749 /// <returns>The vector containing the result of scaling.</returns>
750 /// <since_tizen> 3 </since_tizen>
751 public static Position operator /(Position arg1, float arg2)
753 return arg1?.Divide(arg2);
757 /// Converts a position instance to a Vector3 instance.
759 /// <since_tizen> 3 </since_tizen>
760 public static implicit operator Vector3(Position Position)
762 return new Vector3((float)Position?.X, (float)Position.Y, (float)Position.Z);
766 /// Converts a Vector3 instance to a position instance.
768 /// <since_tizen> 3 </since_tizen>
769 public static implicit operator Position(Vector3 vec)
771 return new Position((float)vec?.X, (float)vec.Y, (float)vec.Z);
775 /// Implicit type cast operator, Position2D to Position
777 /// <param name="position2d">The object of Position2D type.</param>
778 /// <since_tizen> none </since_tizen>
779 /// This will be public opened in tizen_next by ACR.
780 [EditorBrowsable(EditorBrowsableState.Never)]
781 public static implicit operator Position(Position2D position2d)
783 return new Position((float)position2d?.X, (float)position2d.Y, 0);
787 /// Determines whether the specified object is equal to the current object.
789 /// <param name="obj">The object to compare with the current object.</param>
790 /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
791 public override bool Equals(System.Object obj)
793 Position position = obj as Position;
795 if (X == position?.X && Y == position?.Y && Z == position?.Z)
803 /// Gets the the hash code of this Position.
805 /// <returns>The Hash Code.</returns>
806 /// <since_tizen> 6 </since_tizen>
807 public override int GetHashCode()
809 return swigCPtr.Handle.GetHashCode();
813 /// Compares if rhs is equal to.
815 /// <param name="rhs">The vector to compare.</param>
816 /// <returns>Returns true if the two vectors are equal, otherwise false.</returns>
817 /// <since_tizen> 3 </since_tizen>
818 public bool EqualTo(Position rhs)
820 bool ret = Interop.Vector3.Vector3_EqualTo(swigCPtr, Position.getCPtr(rhs));
821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826 /// Compares if rhs is not equal to.
828 /// <param name="rhs">The vector to compare.</param>
829 /// <returns>Returns true if the two vectors are not equal, otherwise false.</returns>
830 /// <since_tizen> 3 </since_tizen>
831 public bool NotEqualTo(Position rhs)
833 bool ret = Interop.Vector3.Vector3_NotEqualTo(swigCPtr, Position.getCPtr(rhs));
834 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
839 [EditorBrowsable(EditorBrowsableState.Never)]
840 public object Clone() => new Position(X, Y, Z);
842 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position obj)
844 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
847 internal static Position GetPositionFromPtr(global::System.IntPtr cPtr)
849 Position ret = new Position(cPtr, false);
850 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
854 /// This will not be public opened.
855 [EditorBrowsable(EditorBrowsableState.Never)]
856 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
858 Interop.Vector3.delete_Vector3(swigCPtr);
862 private Position Add(Position rhs)
864 Position ret = new Position(Interop.Vector3.Vector3_Add(swigCPtr, Position.getCPtr(rhs)), true);
865 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
869 private Position Subtract(Position rhs)
871 Position ret = new Position(Interop.Vector3.Vector3_Subtract__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true);
872 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
876 private Position Multiply(Position rhs)
878 Position ret = new Position(Interop.Vector3.Vector3_Multiply__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true);
879 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
883 private Position Multiply(float rhs)
885 Position ret = new Position(Interop.Vector3.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
886 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
890 private Position Divide(Position rhs)
892 Position ret = new Position(Interop.Vector3.Vector3_Divide__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true);
893 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
897 private Position Divide(float rhs)
899 Position ret = new Position(Interop.Vector3.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
900 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
904 private Position Subtract()
906 Position ret = new Position(Interop.Vector3.Vector3_Subtract__SWIG_1(swigCPtr), true);
907 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911 private float ValueOfIndex(uint index)
913 float ret = Interop.Vector3.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
914 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
918 internal delegate void PositionChangedCallback(float x, float y, float z);
920 internal Position(PositionChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
923 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
926 private PositionChangedCallback callback = null;