2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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.
22 /// The Point3D is a Struct that defining a 3-D point.
24 public struct Point3D : IEquatable<Point3D>
27 /// The X coordinate of a 3D point.
32 /// The Y coordinate of a 3D point.
37 /// The Z coordinate of a 3D point.
41 public override string ToString()
43 return string.Format("{{X={0} Y={1} Z={2}}}", X, Y, Z);
46 public override int GetHashCode()
50 int hashCode = X.GetHashCode();
51 hashCode = (hashCode * 397) ^ Y.GetHashCode();
52 hashCode = (hashCode * 397) ^ Z.GetHashCode();
57 public override bool Equals(object obj)
59 if (!(obj is Point3D))
62 return Equals((Point3D)obj);
65 public bool Equals(Point3D other)
67 return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z);
71 /// Whether the two <see cref="T:Tizen.UI.Point3D" />s are equal.
73 /// <param name="p1">A <see cref="T:Tizen.UI.Point3D" /> on the left hand side.</param>
74 /// <param name="p2">A <see cref="T:Tizen.UI.Point3D" /> on the right hand side.</param>
75 /// <returns>True if the two <see cref="T:Tizen.UI.Point3D" />s have equal values.</returns>
76 public static bool operator ==(Point3D p1, Point3D p2)
82 /// Whether two <see cref="T:Tizen.UI.Point3D" />s are not equal.
84 /// <param name="p1">A <see cref="T:Tizen.UI.Point3D" /> on the left hand side.</param>
85 /// <param name="p2">A <see cref="T:Tizen.UI.Point3D" /> on the right hand side.</param>
86 /// <returns>True if the two <see cref="T:Tizen.UI.Point3D" />s do not have equal values.</returns>
87 public static bool operator !=(Point3D p1, Point3D p2)
89 return !p1.Equals(p2);