2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 public class Position : global::System.IDisposable {
21 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 protected bool swigCMemOwn;
24 internal Position(global::System.IntPtr cPtr, bool cMemoryOwn) {
25 swigCMemOwn = cMemoryOwn;
26 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position obj) {
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34 DisposeQueue.Instance.Add(this);
37 public virtual void Dispose() {
38 if (!Window.IsInstalled()) {
39 DisposeQueue.Instance.Add(this);
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
47 NDalicPINVOKE.delete_Vector3(swigCPtr);
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
51 global::System.GC.SuppressFinalize(this);
56 public static Position operator+(Position arg1, Position arg2) {
57 return arg1.Add(arg2);
60 public static Position operator-(Position arg1, Position arg2) {
61 return arg1.Subtract(arg2);
64 public static Position operator-(Position arg1) {
65 return arg1.Subtract();
68 public static Position operator*(Position arg1, Position arg2) {
69 return arg1.Multiply(arg2);
72 public static Position operator*(Position arg1, float arg2) {
73 return arg1.Multiply(arg2);
76 public static Position operator/(Position arg1, Position arg2) {
77 return arg1.Divide(arg2);
80 public static Position operator/(Position arg1, float arg2) {
81 return arg1.Divide(arg2);
85 public float this[uint index]
89 return ValueOfIndex(index);
93 public static Position GetPositionFromPtr(global::System.IntPtr cPtr) {
94 Position ret = new Position(cPtr, false);
95 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
100 public Position() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) {
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 public Position(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) {
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 public Position(Position2D position2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Position2D.getCPtr(position2d)), true) {
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 private Position Add(Position rhs) {
115 Position ret = new Position(NDalicPINVOKE.Vector3_Add(swigCPtr, Position.getCPtr(rhs)), true);
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 private Position Subtract(Position rhs) {
121 Position ret = new Position(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 private Position Multiply(Position rhs) {
127 Position ret = new Position(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132 private Position Multiply(float rhs) {
133 Position ret = new Position(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 private Position Divide(Position rhs) {
139 Position ret = new Position(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true);
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 private Position Divide(float rhs) {
145 Position ret = new Position(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 private Position Subtract() {
151 Position ret = new Position(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true);
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 private float ValueOfIndex(uint index) {
157 float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index);
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public bool EqualTo(Position rhs) {
163 bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Position.getCPtr(rhs));
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public bool NotEqualTo(Position rhs) {
169 bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Position.getCPtr(rhs));
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 NDalicPINVOKE.Vector3_X_set(swigCPtr, value);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr);
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 NDalicPINVOKE.Vector3_Y_set(swigCPtr, value);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 NDalicPINVOKE.Vector3_Z_set(swigCPtr, value);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 internal static float ParentOriginTop
215 float ret = NDalicPINVOKE.ParentOriginTop_get();
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 internal static float ParentOriginBottom
225 float ret = NDalicPINVOKE.ParentOriginBottom_get();
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 internal static float ParentOriginLeft
235 float ret = NDalicPINVOKE.ParentOriginLeft_get();
236 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 internal static float ParentOriginRight
245 float ret = NDalicPINVOKE.ParentOriginRight_get();
246 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 internal static float ParentOriginMiddle
255 float ret = NDalicPINVOKE.ParentOriginMiddle_get();
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 internal static Position ParentOriginTopLeft
265 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopLeft_get();
266 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 internal static Position ParentOriginTopCenter
276 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopCenter_get();
277 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
283 internal static Position ParentOriginTopRight
287 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopRight_get();
288 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 internal static Position ParentOriginCenterLeft
298 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterLeft_get();
299 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 internal static Position ParentOriginCenter
309 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenter_get();
310 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 internal static Position ParentOriginCenterRight
320 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterRight_get();
321 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
327 internal static Position ParentOriginBottomLeft
331 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomLeft_get();
332 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 internal static Position ParentOriginBottomCenter
342 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomCenter_get();
343 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 internal static Position ParentOriginBottomRight
353 global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomRight_get();
354 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
355 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 internal static float AnchorPointTop
364 float ret = NDalicPINVOKE.AnchorPointTop_get();
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 internal static float AnchorPointBottom
374 float ret = NDalicPINVOKE.AnchorPointBottom_get();
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
380 internal static float AnchorPointLeft
384 float ret = NDalicPINVOKE.AnchorPointLeft_get();
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 internal static float AnchorPointRight
394 float ret = NDalicPINVOKE.AnchorPointRight_get();
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
400 internal static float AnchorPointMiddle
404 float ret = NDalicPINVOKE.AnchorPointMiddle_get();
405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
410 internal static Position AnchorPointTopLeft
414 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopLeft_get();
415 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 internal static Position AnchorPointTopCenter
425 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopCenter_get();
426 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
432 internal static Position AnchorPointTopRight
436 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopRight_get();
437 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
438 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
443 internal static Position AnchorPointCenterLeft
447 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterLeft_get();
448 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
449 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
454 internal static Position AnchorPointCenter
458 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenter_get();
459 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
460 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465 internal static Position AnchorPointCenterRight
469 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterRight_get();
470 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
471 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
476 internal static Position AnchorPointBottomLeft
480 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomLeft_get();
481 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
487 internal static Position AnchorPointBottomCenter
491 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomCenter_get();
492 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
493 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
498 internal static Position AnchorPointBottomRight
502 global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomRight_get();
503 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
509 public static Position One {
511 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get();
512 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
513 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 internal static Position XAxis {
520 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get();
521 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 internal static Position YAxis {
529 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get();
530 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
531 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 internal static Position ZAxis {
538 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get();
539 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
540 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 internal static Position NegativeXAxis {
547 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get();
548 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
549 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554 internal static Position NegativeYAxis {
556 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get();
557 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
558 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
563 internal static Position NegativeZAxis {
565 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get();
566 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
567 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
572 public static Position Zero {
574 global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get();
575 Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false);
576 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
581 public static implicit operator Vector3(Position Position)
583 return new Vector3(Position.X, Position.Y, Position.Z);
586 public static implicit operator Position(Vector3 vec)
588 return new Position(vec.X, vec.Y, vec.Z);
593 public struct ParentOrigin
595 public static readonly float Top = Position.ParentOriginTop;
596 public static readonly float Bottom = Position.ParentOriginBottom;
597 public static readonly float Left = Position.ParentOriginLeft;
598 public static readonly float Right = Position.ParentOriginRight;
599 public static readonly float Middle = Position.ParentOriginMiddle;
600 public static readonly Position TopLeft = Position.ParentOriginTopLeft;
601 public static readonly Position TopCenter = Position.ParentOriginTopCenter;
602 public static readonly Position TopRight = Position.ParentOriginTopRight;
603 public static readonly Position CenterLeft = Position.ParentOriginCenterLeft;
604 public static readonly Position Center = Position.ParentOriginCenter;
605 public static readonly Position CenterRight = Position.ParentOriginCenterRight;
606 public static readonly Position BottomLeft = Position.ParentOriginBottomLeft;
607 public static readonly Position BottomCenter = Position.ParentOriginBottomCenter;
608 public static readonly Position BottomRight = Position.ParentOriginBottomRight;
610 public struct AnchorPoint
612 public static readonly float Top = Position.AnchorPointTop;
613 public static readonly float Bottom = Position.AnchorPointBottom;
614 public static readonly float Left = Position.AnchorPointLeft;
615 public static readonly float Right = Position.AnchorPointRight;
616 public static readonly float Middle = Position.AnchorPointMiddle;
617 public static readonly Position TopLeft = Position.AnchorPointTopLeft;
618 public static readonly Position TopCenter = Position.AnchorPointTopCenter;
619 public static readonly Position TopRight = Position.AnchorPointTopRight;
620 public static readonly Position CenterLeft = Position.AnchorPointCenterLeft;
621 public static readonly Position Center = Position.AnchorPointCenter;
622 public static readonly Position CenterRight = Position.AnchorPointCenterRight;
623 public static readonly Position BottomLeft = Position.AnchorPointBottomLeft;
624 public static readonly Position BottomCenter = Position.AnchorPointBottomCenter;
625 public static readonly Position BottomRight = Position.AnchorPointBottomRight;
627 public struct PositionAxis
629 public static readonly Position X = Position.XAxis;
630 public static readonly Position Y = Position.YAxis;
631 public static readonly Position Z = Position.ZAxis;
632 public static readonly Position NegativeX = Position.NegativeXAxis;
633 public static readonly Position NegativeY = Position.NegativeYAxis;
634 public static readonly Position NegativeZ = Position.NegativeZAxis;