Add High Level classes for Color, Size, Position
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / manual / csharp / Position.cs
1 namespace Dali {
2
3 using System;
4
5 public class Position : Vector3
6        {
7
8   /**
9    * @brief constructor
10    *
11    * @since 1.0.0
12    */
13            public Position()
14                : base()
15            {
16            }
17
18   /**
19    * @brief constructor
20    *
21    * @since 1.0.0
22    * @param [in] a The Position X.
23    * @param [in] b The Position Y.
24    * @param [in] c The Position Z.
25    */
26            public Position(float a, float b, float c)
27                : base(a, b, c)
28            {
29            }
30            
31   /**
32    * @brief constructor
33    *
34    * @since 1.0.0
35    * @param [in] o The Vector Position X, Y, Z.
36    */
37            public Position(Vector3 o)
38                : base(o.x, o.y, o.z)
39            {      
40            }
41
42   ///< name "X", type float (Position X value)
43   //@since 1.0.0
44            public float X
45            {
46                get { return width; }
47                set { width = value; }
48            }
49
50   ///< name "Y", type float (Position Y value)
51   //@since 1.0.0
52            public float Y
53            {
54                get { return height; }
55                set { height = value; }
56            }
57
58   ///< name "Z", type float (Position Z value)
59   //@since 1.0.0
60            public float Z
61            {
62                get { return depth; }
63                set { depth = value; }
64            }
65    
66   /**
67    * @brief operator+
68    *
69    * @since 1.0.0
70    * @param [in] l The Position to add.
71    * @param [in] r The Position to add
72    * @return A reference to this
73    */ 
74            public static Position operator +(Position l, Position r)
75            {
76                return new Position(l.X + r.X, l.Y + r.Y, l.Z + r.Z);
77            }
78
79   /**
80    * @brief operator-
81    *
82    * @since 1.0.0
83    * @param [in] l The Position to add.
84    * @param [in] r The Position to add
85    * @return A reference to this
86    */ 
87            public static Position operator -(Position l, Position r)
88            {
89                return new Position(l.X - r.X, l.Y - r.Y, l.Z - r.Z);
90            }
91
92   /**
93    * @brief operator*
94    *
95    * @since 1.0.0
96    * @param [in] l The Position to add.
97    * @param [in] r The Position to add
98    * @return A reference to this
99    */ 
100            public static Position operator *(Position a, double b)
101            {
102                return new Position((int)(a.X * b), (int)(a.Y * b), (int)(a.Z * b));
103            }
104
105   /**
106    * @brief operator/
107    *
108    * @since 1.0.0
109    * @param [in] l The Position to add.
110    * @param [in] r The Position to add
111    * @return A reference to this
112    */ 
113            public static float operator /(Position a, Position b)
114            {
115                return (float)System.Math.Sqrt((a.X / b.X) * (a.Y / b.Y) * (a.Z / b.Z));
116            }
117
118   /**
119    * @brief Equals
120    *
121    * @since 1.0.0
122    * @param [in] o The Position object to compare.
123    * @param [in] r The Position to add
124    * @return bool, whether object equal or not
125    */
126            public override bool Equals(object obj)
127            {
128                Position r = obj as Position;
129                if (r == null)
130                {
131                    return false;
132                }
133                return this.X == r.X && this.Y == r.Y && this.Z == r.Z;
134            }
135
136   /**
137    * @brief GetHashCode
138    *
139    * @since 1.0.0
140    * @return int, hascode of position
141    */
142            public override int GetHashCode()
143            {
144                return base.GetHashCode();
145            }
146
147   /**
148    * @brief Clone
149    *
150    * @since 1.0.0
151    * @return Positin object
152    */
153            public Position Clone()
154            {
155                Position copy = new Position(X, Y, Z);
156                return copy;
157            }
158       }
159
160 }