using RichCreator.Utility.Utilitys; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RichCreator.Utility.Structs { /// /// 线 /// public struct ZTLinePoint:IEquatable { public static ZTLinePoint Empty; public ZTLinePoint(ZTPoint p1, ZTPoint p2) { this.P1 = p1; this.P2 = p2; } public ZTPoint P1; public ZTPoint P2; public Int32 GetDistance() { return (Int32)GeoHelper.GetPointDistance(this.P1, this.P2); } public Int32 X1 { get { return P1.X; } set { P1.X = value; } } public Int32 X2 { get { return P2.X; } set { P2.X = value; } } public Int32 Y1 { get { return P1.Y; } set { P1.Y = value; } } public Int32 Y2 { get { return P2.Y; } set { P2.Y = value; } } public bool Equals(ZTLinePoint other) { if ((this.P1.Equals(other.P1) && this.P2.Equals(other.P2)) || (this.P1.Equals(other.P2) && this.P2.Equals(other.P1))) { return true; } return false; } } }