/* * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System; using Tizen.NUI.Binding; using System.ComponentModel; namespace Tizen.NUI { /// /// Position is a three-dimensional vector. /// /// 3 [Tizen.NUI.Binding.TypeConverter(typeof(PositionTypeConverter))] public class Position : Disposable, ICloneable { /// /// The constructor. /// /// /// Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting.
/// For example, the followings are possible.
/// view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost.
/// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default.
///
/// 3 public Position() : this(Interop.Vector3.NewVector3(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// The constructor. /// /// The x component. /// The y component. /// The z component(optional). /// /// Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting.
/// For example, the followings are possible.
/// view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost.
/// view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default.
///
/// 3 public Position(float x, float y, float z = 0.0f) : this(Interop.Vector3.NewVector3(x, y, z), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// The constructor. /// /// Position2D to create this vector from. /// 3 public Position(Position2D position2d) : this(Interop.Vector3.NewVector3WithVector2(Position2D.getCPtr(position2d)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Position(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } /// /// ParentOrigin constants. It's 0.0. /// /// 3 public static float ParentOriginTop { get { float ret = Interop.NDalicParentOrigin.ParentOriginTopGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants. It's 1.0. /// /// 3 public static float ParentOriginBottom { get { float ret = Interop.NDalicParentOrigin.ParentOriginBottomGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants. It's 0.0. /// /// 3 public static float ParentOriginLeft { get { float ret = Interop.NDalicParentOrigin.ParentOriginLeftGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants. It's 1.0. /// /// 3 public static float ParentOriginRight { get { float ret = Interop.NDalicParentOrigin.ParentOriginRightGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants. It's 0.5. /// /// 3 public static float ParentOriginMiddle { get { float ret = Interop.NDalicParentOrigin.ParentOriginMiddleGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 0.0, 0.0, 0.5. /// /// 3 public static Position ParentOriginTopLeft { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopLeftGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 0.5, 0.0, 0.5. /// /// 3 public static Position ParentOriginTopCenter { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopCenterGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 1.0, 0.0, 0.5. /// /// 3 public static Position ParentOriginTopRight { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginTopRightGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 0.0, 0.5, 0.5. /// /// 3 public static Position ParentOriginCenterLeft { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterLeftGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 0.0, 0.5, 0.5 /// /// 3 public static Position ParentOriginCenter { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 1.0, 0.5, 0.5. /// /// 3 public static Position ParentOriginCenterRight { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginCenterRightGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 0.0f, 1.0f, 0.5f. /// /// 3 public static Position ParentOriginBottomLeft { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomLeftGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 0.5, 1.0, 0.5. /// /// 3 public static Position ParentOriginBottomCenter { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomCenterGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// ParentOrigin constants: 1.0, 1.0, 0.5. /// /// 3 public static Position ParentOriginBottomRight { get { global::System.IntPtr cPtr = Interop.NDalicParentOrigin.ParentOriginBottomRightGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.0. /// /// 3 public static float PivotPointTop { get { float ret = Interop.NDalicAnchorPoint.AnchorPointTopGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 1.0. /// /// 3 public static float PivotPointBottom { get { float ret = Interop.NDalicAnchorPoint.AnchorPointBottomGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.0. /// /// 3 public static float PivotPointLeft { get { float ret = Interop.NDalicAnchorPoint.AnchorPointLeftGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 1.0. /// /// 3 public static float PivotPointRight { get { float ret = Interop.NDalicAnchorPoint.AnchorPointRightGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.0. /// /// 3 public static float PivotPointMiddle { get { float ret = Interop.NDalicAnchorPoint.AnchorPointMiddleGet(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.0, 0.0, 0.5. /// /// 3 public static Position PivotPointTopLeft { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopLeftGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.5, 0.0, 0.5. /// /// 3 public static Position PivotPointTopCenter { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopCenterGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 1.0, 0.0, 0.5. /// /// 3 public static Position PivotPointTopRight { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointTopRightGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.0, 0.5, 0.5. /// /// 3 public static Position PivotPointCenterLeft { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterLeftGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.5, 0.5, 0.5. /// /// 3 public static Position PivotPointCenter { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 1.0, 0.5, 0.5. /// /// 3 public static Position PivotPointCenterRight { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointCenterRightGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.0, 1.0, 0.5. /// /// 3 public static Position PivotPointBottomLeft { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomLeftGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 0.5, 1.0, 0.5 /// /// 3 public static Position PivotPointBottomCenter { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomCenterGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// PivotPoint constants: 1.0, 1.0, 0.5. /// /// 3 public static Position PivotPointBottomRight { get { global::System.IntPtr cPtr = Interop.NDalicAnchorPoint.AnchorPointBottomRightGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// Constant ( 1.0f, 1.0f, 1.0f ). /// /// 3 public static Position One { get { global::System.IntPtr cPtr = Interop.Vector3.OneGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// Constant ( 0.0f, 0.0f, 0.0f ). /// /// 3 public static Position Zero { get { global::System.IntPtr cPtr = Interop.Vector3.ZeroGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// The x component. /// /// /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor. /// /// /// // DO NOT use like the followings! /// Position position = new Position(); /// position.X = 1.0f; /// // Please USE like this /// float x = 1.0f, y = 2.0f, z = 3.0f; /// Position position = new Position(x, y, z); /// /// 3 public float X { set { Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor"); Interop.Vector3.XSet(SwigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z); } get { float ret = Interop.Vector3.XGet(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// The y component. /// /// /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor. /// /// /// // DO NOT use like the followings! /// Position position = new Position(); /// position.Y = 2.0f; /// // Please USE like this /// float x = 1.0f, y = 2.0f, z = 3.0f; /// Position position = new Position(x, y, z); /// /// 3 public float Y { set { Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor"); Interop.Vector3.YSet(SwigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z); } get { float ret = Interop.Vector3.YGet(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } /// /// The z component. /// /// /// The setter is deprecated in API8 and will be removed in API10. Please use new Position(...) constructor. /// /// /// // DO NOT use like the followings! /// Position position = new Position(); /// position.Z = 3.0f; /// // Please USE like this /// float x = 1.0f, y = 2.0f, z = 3.0f; /// Position position = new Position(x, y, z); /// /// 3 public float Z { set { Tizen.Log.Fatal("NUI", "Please do not use this setter, Deprecated in API8, will be removed in API10. please use new Position(...) constructor"); Interop.Vector3.ZSet(SwigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); callback?.Invoke(X, Y, Z); } get { float ret = Interop.Vector3.ZGet(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve()); return ret; } } internal static Position XAxis { get { global::System.IntPtr cPtr = Interop.Vector3.XaxisGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } internal static Position YAxis { get { global::System.IntPtr cPtr = Interop.Vector3.YaxisGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } internal static Position ZAxis { get { global::System.IntPtr cPtr = Interop.Vector3.ZaxisGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } internal static Position NegativeXAxis { get { global::System.IntPtr cPtr = Interop.Vector3.NegativeXaxisGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } internal static Position NegativeYAxis { get { global::System.IntPtr cPtr = Interop.Vector3.NegativeYaxisGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } internal static Position NegativeZAxis { get { global::System.IntPtr cPtr = Interop.Vector3.NegativeZaxisGet(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// /// The const array subscript operator overload. Should be 0, 1, or 2. /// /// The subscript index. /// The float at the given index. /// 3 public float this[uint index] { get { return ValueOfIndex(index); } } /// /// An addition operator. /// /// The vector to add. /// The vector to add. /// The vector containing the result of the addition. /// 3 public static Position operator +(Position arg1, Position arg2) { return arg1?.Add(arg2); } /// /// The subtraction operator. /// /// The vector to subtract. /// The vector to subtract. /// The vector containing the result of the subtraction. /// 3 public static Position operator -(Position arg1, Position arg2) { return arg1?.Subtract(arg2); } /// /// The unary negation operator. /// /// The vector to negate. /// The vector containg the negation. /// 3 public static Position operator -(Position arg1) { return arg1?.Subtract(); } /// /// The multiplication operator. /// /// The vector to multiply. /// The vector to multiply. /// The vector containing the result of the multiplication. /// 3 public static Position operator *(Position arg1, Position arg2) { return arg1?.Multiply(arg2); } /// /// The multiplication operator. /// /// The vector to multiply /// The float value to scale the vector. /// The vector containing the result of scaling. /// 3 public static Position operator *(Position arg1, float arg2) { return arg1?.Multiply(arg2); } /// /// The division operator. /// /// The vector to divide. /// The vector to divide. /// The vector containing the result of the division. /// 3 public static Position operator /(Position arg1, Position arg2) { return arg1?.Divide(arg2); } /// /// The division operator. /// /// The vector to divide. /// The float value to scale the vector by. /// The vector containing the result of scaling. /// 3 public static Position operator /(Position arg1, float arg2) { return arg1?.Divide(arg2); } /// /// Converts a position instance to a Vector3 instance. /// /// 3 public static implicit operator Vector3(Position Position) { return new Vector3((float)Position?.X, (float)Position.Y, (float)Position.Z); } /// /// Converts a Vector3 instance to a position instance. /// /// 3 public static implicit operator Position(Vector3 vec) { return new Position((float)vec?.X, (float)vec.Y, (float)vec.Z); } /// /// Implicit type cast operator, Position2D to Position /// /// The object of Position2D type. /// none /// This will be public opened in tizen_next by ACR. [EditorBrowsable(EditorBrowsableState.Never)] public static implicit operator Position(Position2D position2d) { return new Position((float)position2d?.X, (float)position2d.Y, 0); } /// /// Determines whether the specified object is equal to the current object. /// /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. public override bool Equals(System.Object obj) { Position position = obj as Position; bool equal = false; if (X == position?.X && Y == position?.Y && Z == position?.Z) { equal = true; } return equal; } /// /// Gets the the hash code of this Position. /// /// The Hash Code. /// 6 public override int GetHashCode() { return SwigCPtr.Handle.GetHashCode(); } /// /// Compares if rhs is equal to. /// /// The vector to compare. /// Returns true if the two vectors are equal, otherwise false. /// 3 public bool EqualTo(Position rhs) { bool ret = Interop.Vector3.EqualTo(SwigCPtr, Position.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// /// Compares if rhs is not equal to. /// /// The vector to compare. /// Returns true if the two vectors are not equal, otherwise false. /// 3 public bool NotEqualTo(Position rhs) { bool ret = Interop.Vector3.NotEqualTo(SwigCPtr, Position.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// [EditorBrowsable(EditorBrowsableState.Never)] public object Clone() => new Position(X, Y, Z); internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr; } internal static Position GetPositionFromPtr(global::System.IntPtr cPtr) { Position ret = new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Vector3.DeleteVector3(swigCPtr); } private Position Add(Position rhs) { Position ret = new Position(Interop.Vector3.Add(SwigCPtr, Position.getCPtr(rhs)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private Position Subtract(Position rhs) { Position ret = new Position(Interop.Vector3.Subtract(SwigCPtr, Position.getCPtr(rhs)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private Position Multiply(Position rhs) { Position ret = new Position(Interop.Vector3.Multiply(SwigCPtr, Position.getCPtr(rhs)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private Position Multiply(float rhs) { Position ret = new Position(Interop.Vector3.Multiply(SwigCPtr, rhs), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private Position Divide(Position rhs) { Position ret = new Position(Interop.Vector3.Divide(SwigCPtr, Position.getCPtr(rhs)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private Position Divide(float rhs) { Position ret = new Position(Interop.Vector3.Divide(SwigCPtr, rhs), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private Position Subtract() { Position ret = new Position(Interop.Vector3.Subtract(SwigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } private float ValueOfIndex(uint index) { float ret = Interop.Vector3.ValueOfIndex(SwigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal delegate void PositionChangedCallback(float x, float y, float z); internal Position(PositionChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.NewVector3(x, y, z), true) { callback = cb; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } private PositionChangedCallback callback = null; } }