Merge "Stop copying Property::Maps in ImageView SetProperty" into devel/master
[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 substract.
84    * @param [in] r The Position to substract
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] a The Position to multiply.
97    * @param [in] b The Position to multiply
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] a The Position to divide.
110    * @param [in] b The Position to divide
111    * @return float value of division operation
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    * @return bool, whether object equal or not
124    */
125            public override bool Equals(object obj)
126            {
127                Position r = obj as Position;
128                if (r == null)
129                {
130                    return false;
131                }
132                return this.X == r.X && this.Y == r.Y && this.Z == r.Z;
133            }
134
135   /**
136    * @brief GetHashCode
137    *
138    * @since 1.0.0
139    * @return int, hascode of position
140    */
141            public override int GetHashCode()
142            {
143                return base.GetHashCode();
144            }
145
146   /**
147    * @brief Clone
148    *
149    * @since 1.0.0
150    * @return Position object
151    */
152            public Position Clone()
153            {
154                Position copy = new Position(X, Y, Z);
155                return copy;
156            }
157       }
158
159 }