Exemplo n.º 1
0
 /// <summary>
 /// Checks whether the two points are spatially equal
 /// </summary>
 /// <param name="p1">Point 1</param>
 /// <param name="p2">Point 2</param>
 /// <returns>true if the points a spatially equal</returns>
 public bool Equals(Point3D p1, Point3D p2)
 {
     return (p1.X == p2.X && p1.Y == p2.Y && p1.Z == p2.Z);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Comparator used for ordering point first by ascending X, then by ascending Y and then by ascending Z.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public virtual int CompareTo(Point3D other)
        {
            if (X < other.X || X == other.X && Y < other.Y || X == other.X && Y == other.Y && Z < other.Z)
                return -1;

            if (X > other.X || X == other.X && Y > other.Y || X == other.X && Y == other.Y && Z > other.Z)
                return 1;

            return 0;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Checks whether this instance is spatially equal to the Point 'o'
 /// </summary>
 /// <param name="p">Point to compare to</param>
 /// <returns></returns>
 public bool Equals(Point3D p)
 {
     return base.Equals(p) && p.Z == z;
 }