| | |
| | | using System; |
| | | using RichCreator.Utility.Utilitys; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | /// <summary> |
| | | /// 线 |
| | | /// </summary> |
| | | public class ZTLinePoint |
| | | public struct ZTLinePoint:IEquatable<ZTLinePoint> |
| | | { |
| | | public static ZTLinePoint Empty; |
| | | |
| | | private ZTPoint p1; |
| | | private ZTPoint p2; |
| | | |
| | | public ZTLinePoint() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | public ZTLinePoint(ZTPoint p1, ZTPoint p2) |
| | | { |
| | | this.p1 = p1; |
| | | this.p2 = p2; |
| | | this.P1 = p1; |
| | | this.P2 = p2; |
| | | } |
| | | |
| | | public ZTPoint P1 |
| | | public ZTPoint P1; |
| | | |
| | | public ZTPoint P2; |
| | | |
| | | public Int32 GetDistance() |
| | | { |
| | | get { return p1; } |
| | | set { p1 = value; } |
| | | return (Int32)GeoHelper.GetPointDistance(this.P1, this.P2); |
| | | } |
| | | |
| | | public ZTPoint P2 |
| | | { |
| | | get { return p2; } |
| | | set { p2 = value; } |
| | | } |
| | | |
| | | [ZTImage.Reflection.UnSerializedAttribute] |
| | | |
| | | public Int32 X1 |
| | | { |
| | | get { return p1.X; } |
| | | set { p1.X = value; } |
| | | get { return P1.X; } |
| | | set { P1.X = value; } |
| | | } |
| | | |
| | | [ZTImage.Reflection.UnSerializedAttribute] |
| | | |
| | | public Int32 X2 |
| | | { |
| | | get { return p2.X; } |
| | | set { p2.X = value; } |
| | | get { return P2.X; } |
| | | set { P2.X = value; } |
| | | } |
| | | |
| | | [ZTImage.Reflection.UnSerializedAttribute] |
| | | |
| | | public Int32 Y1 |
| | | { |
| | | get { return p1.Y; } |
| | | set { p1.Y = value; } |
| | | get { return P1.Y; } |
| | | set { P1.Y = value; } |
| | | } |
| | | |
| | | [ZTImage.Reflection.UnSerializedAttribute] |
| | | |
| | | public Int32 Y2 |
| | | { |
| | | get { return p2.Y; } |
| | | set { p2.Y = value; } |
| | | get { return P2.Y; } |
| | | set { P2.Y = value; } |
| | | } |
| | | |
| | | public static bool operator !=(ZTLinePoint a, ZTLinePoint b) |
| | | |
| | | public bool Equals(ZTLinePoint other) |
| | | { |
| | | if (a == b) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public static bool operator ==(ZTLinePoint a, ZTLinePoint b) |
| | | { |
| | | if ((a.p1 .Equals( b.p1) && a.p2.Equals(b.p2)) || (a.p1 .Equals( b.p2) && a.p2.Equals(b.p1))) |
| | | if ((this.P1.Equals(other.P1) && this.P2.Equals(other.P2)) || (this.P1.Equals(other.P2) && this.P2.Equals(other.P1))) |
| | | { |
| | | return true; |
| | | } |