2 * Copyright (c) 2021 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.NewVector3(), 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.NewVector3(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.NewVector3WithVector2(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.ParentOriginTopGet();
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginBottomGet();
103 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginLeftGet();
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginRightGet();
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginMiddleGet();
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginTopLeftGet();
159 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginTopCenterGet();
174 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginTopRightGet();
189 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginCenterLeftGet();
204 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginCenterGet();
219 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginCenterRightGet();
234 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginBottomLeftGet();
249 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginBottomCenterGet();
264 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ParentOriginBottomRightGet();
279 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
280 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
286 /// PivotPoint constants: 0.0.
288 /// <since_tizen> 3 </since_tizen>
289 public static float PivotPointTop
293 float ret = Interop.NDalicAnchorPoint.AnchorPointTopGet();
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
300 /// PivotPoint constants: 1.0.
302 /// <since_tizen> 3 </since_tizen>
303 public static float PivotPointBottom
307 float ret = Interop.NDalicAnchorPoint.AnchorPointBottomGet();
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
314 /// PivotPoint constants: 0.0.
316 /// <since_tizen> 3 </since_tizen>
317 public static float PivotPointLeft
321 float ret = Interop.NDalicAnchorPoint.AnchorPointLeftGet();
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
328 /// PivotPoint constants: 1.0.
330 /// <since_tizen> 3 </since_tizen>
331 public static float PivotPointRight
335 float ret = Interop.NDalicAnchorPoint.AnchorPointRightGet();
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
342 /// PivotPoint constants: 0.5.
344 /// <since_tizen> 3 </since_tizen>
345 public static float PivotPointMiddle
349 float ret = Interop.NDalicAnchorPoint.AnchorPointMiddleGet();
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointTopLeftGet();
364 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointTopCenterGet();
379 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
380 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointTopRightGet();
394 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointCenterLeftGet();
409 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
410 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointCenterGet();
424 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointCenterRightGet();
439 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
440 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointBottomLeftGet();
454 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointBottomCenterGet();
469 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.AnchorPointBottomRightGet();
484 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
485 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.OneGet();
499 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
500 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", 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.ZeroGet();
514 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
524 /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor.
527 /// // DO NOT use like the followings!
528 /// Position position = new Position();
529 /// position.X = 1.0f;
530 /// // Please USE like this
531 /// float x = 1.0f, y = 2.0f, z = 3.0f;
532 /// Position position = new Position(x, y, z);
534 /// <since_tizen> 3 </since_tizen>
537 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
540 Interop.Vector3.XSet(SwigCPtr, value);
541 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543 callback?.Invoke(X, Y, Z);
547 float ret = Interop.Vector3.XGet(SwigCPtr);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
557 /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor.
560 /// // DO NOT use like the followings!
561 /// Position position = new Position();
562 /// position.Y = 2.0f;
563 /// // Please USE like this
564 /// float x = 1.0f, y = 2.0f, z = 3.0f;
565 /// Position position = new Position(x, y, z);
567 /// <since_tizen> 3 </since_tizen>
570 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
573 Interop.Vector3.YSet(SwigCPtr, value);
574 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
576 callback?.Invoke(X, Y, Z);
580 float ret = Interop.Vector3.YGet(SwigCPtr);
581 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
590 /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor.
593 /// // DO NOT use like the followings!
594 /// Position position = new Position();
595 /// position.Z = 3.0f;
596 /// // Please USE like this
597 /// float x = 1.0f, y = 2.0f, z = 3.0f;
598 /// Position position = new Position(x, y, z);
600 /// <since_tizen> 3 </since_tizen>
603 [Obsolete("Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor")]
606 Interop.Vector3.ZSet(SwigCPtr, value);
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
609 callback?.Invoke(X, Y, Z);
613 float ret = Interop.Vector3.ZGet(SwigCPtr);
614 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
619 internal static Position XAxis
623 global::System.IntPtr cPtr = Interop.Vector3.XaxisGet();
624 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 internal static Position YAxis
634 global::System.IntPtr cPtr = Interop.Vector3.YaxisGet();
635 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641 internal static Position ZAxis
645 global::System.IntPtr cPtr = Interop.Vector3.ZaxisGet();
646 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 internal static Position NegativeXAxis
656 global::System.IntPtr cPtr = Interop.Vector3.NegativeXaxisGet();
657 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
658 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
663 internal static Position NegativeYAxis
667 global::System.IntPtr cPtr = Interop.Vector3.NegativeYaxisGet();
668 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
669 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
674 internal static Position NegativeZAxis
678 global::System.IntPtr cPtr = Interop.Vector3.NegativeZaxisGet();
679 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
680 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
686 /// The const array subscript operator overload. Should be 0, 1, or 2.
688 /// <param name="index">The subscript index.</param>
689 /// <returns>The float at the given index.</returns>
690 /// <since_tizen> 3 </since_tizen>
691 public float this[uint index]
695 return ValueOfIndex(index);
701 /// An addition operator.
703 /// <param name="arg1">The vector to add.</param>
704 /// <param name="arg2">The vector to add.</param>
705 /// <returns>The vector containing the result of the addition.</returns>
706 /// <since_tizen> 3 </since_tizen>
707 public static Position operator +(Position arg1, Position arg2)
709 return arg1?.Add(arg2);
713 /// The subtraction operator.
715 /// <param name="arg1">The vector to subtract.</param>
716 /// <param name="arg2">The vector to subtract.</param>
717 /// <returns>The vector containing the result of the subtraction.</returns>
718 /// <since_tizen> 3 </since_tizen>
719 public static Position operator -(Position arg1, Position arg2)
721 return arg1?.Subtract(arg2);
725 /// The unary negation operator.
727 /// <param name="arg1">The vector to negate.</param>
728 /// <returns>The vector containg the negation.</returns>
729 /// <since_tizen> 3 </since_tizen>
730 public static Position operator -(Position arg1)
732 return arg1?.Subtract();
736 /// The multiplication operator.
738 /// <param name="arg1">The vector to multiply.</param>
739 /// <param name="arg2">The vector to multiply.</param>
740 /// <returns>The vector containing the result of the multiplication.</returns>
741 /// <since_tizen> 3 </since_tizen>
742 public static Position operator *(Position arg1, Position arg2)
744 return arg1?.Multiply(arg2);
748 /// The multiplication operator.
750 /// <param name="arg1">The vector to multiply</param>
751 /// <param name="arg2">The float value to scale the vector.</param>
752 /// <returns>The vector containing the result of scaling.</returns>
753 /// <since_tizen> 3 </since_tizen>
754 public static Position operator *(Position arg1, float arg2)
756 return arg1?.Multiply(arg2);
760 /// The division operator.
762 /// <param name="arg1">The vector to divide.</param>
763 /// <param name="arg2">The vector to divide.</param>
764 /// <returns>The vector containing the result of the division.</returns>
765 /// <since_tizen> 3 </since_tizen>
766 public static Position operator /(Position arg1, Position arg2)
768 return arg1?.Divide(arg2);
772 /// The division operator.
774 /// <param name="arg1">The vector to divide.</param>
775 /// <param name="arg2">The float value to scale the vector by.</param>
776 /// <returns>The vector containing the result of scaling.</returns>
777 /// <since_tizen> 3 </since_tizen>
778 public static Position operator /(Position arg1, float arg2)
780 return arg1?.Divide(arg2);
784 /// Converts a position instance to a Vector3 instance.
786 /// <since_tizen> 3 </since_tizen>
787 public static implicit operator Vector3(Position position)
789 if (position == null)
793 return new Vector3(position.X, position.Y, position.Z);
797 /// Converts a Vector3 instance to a position instance.
799 /// <since_tizen> 3 </since_tizen>
800 public static implicit operator Position(Vector3 vec)
806 return new Position(vec.X, vec.Y, vec.Z);
810 /// Implicit type cast operator, Position2D to Position
812 /// <param name="position2d">The object of Position2D type.</param>
813 /// <since_tizen> none </since_tizen>
814 /// This will be public opened in tizen_next by ACR.
815 [EditorBrowsable(EditorBrowsableState.Never)]
816 public static implicit operator Position(Position2D position2d)
818 if (position2d == null)
822 return new Position(position2d.X, position2d.Y, 0);
826 /// Determines whether the specified object is equal to the current object.
828 /// <param name="obj">The object to compare with the current object.</param>
829 /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
830 public override bool Equals(System.Object obj)
832 Position position = obj as Position;
834 if (X == position?.X && Y == position?.Y && Z == position?.Z)
842 /// Gets the hash code of this Position.
844 /// <returns>The Hash Code.</returns>
845 /// <since_tizen> 6 </since_tizen>
846 public override int GetHashCode()
848 return SwigCPtr.Handle.GetHashCode();
852 /// Compares if rhs is equal to.
854 /// <param name="rhs">The vector to compare.</param>
855 /// <returns>Returns true if the two vectors are equal, otherwise false.</returns>
856 /// <since_tizen> 3 </since_tizen>
857 public bool EqualTo(Position rhs)
859 bool ret = Interop.Vector3.EqualTo(SwigCPtr, Position.getCPtr(rhs));
860 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
865 /// Compares if rhs is not equal to.
867 /// <param name="rhs">The vector to compare.</param>
868 /// <returns>Returns true if the two vectors are not equal, otherwise false.</returns>
869 /// <since_tizen> 3 </since_tizen>
870 public bool NotEqualTo(Position rhs)
872 bool ret = Interop.Vector3.NotEqualTo(SwigCPtr, Position.getCPtr(rhs));
873 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
878 [EditorBrowsable(EditorBrowsableState.Never)]
879 public object Clone() => new Position(X, Y, Z);
881 internal static Position GetPositionFromPtr(global::System.IntPtr cPtr)
883 Position ret = new Position(cPtr, false);
884 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
888 /// This will not be public opened.
889 [EditorBrowsable(EditorBrowsableState.Never)]
890 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
892 Interop.Vector3.DeleteVector3(swigCPtr);
896 private Position Add(Position rhs)
898 Position ret = new Position(Interop.Vector3.Add(SwigCPtr, Position.getCPtr(rhs)), true);
899 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
903 private Position Subtract(Position rhs)
905 Position ret = new Position(Interop.Vector3.Subtract(SwigCPtr, Position.getCPtr(rhs)), true);
906 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
910 private Position Multiply(Position rhs)
912 Position ret = new Position(Interop.Vector3.Multiply(SwigCPtr, Position.getCPtr(rhs)), true);
913 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
917 private Position Multiply(float rhs)
919 Position ret = new Position(Interop.Vector3.Multiply(SwigCPtr, rhs), true);
920 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
924 private Position Divide(Position rhs)
926 Position ret = new Position(Interop.Vector3.Divide(SwigCPtr, Position.getCPtr(rhs)), true);
927 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
931 private Position Divide(float rhs)
933 Position ret = new Position(Interop.Vector3.Divide(SwigCPtr, rhs), true);
934 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
938 private Position Subtract()
940 Position ret = new Position(Interop.Vector3.Subtract(SwigCPtr), true);
941 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
945 private float ValueOfIndex(uint index)
947 float ret = Interop.Vector3.ValueOfIndex(SwigCPtr, index);
948 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
952 internal delegate void PositionChangedCallback(float x, float y, float z);
954 internal Position(PositionChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.NewVector3(x, y, z), true)
957 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
960 private PositionChangedCallback callback = null;