using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace RichCreator.Utility.Structs
|
{
|
/// <summary>
|
/// 线
|
/// </summary>
|
public class 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;
|
}
|
|
public ZTPoint P1
|
{
|
get { return p1; }
|
set { p1 = value; }
|
}
|
|
public ZTPoint P2
|
{
|
get { return p2; }
|
set { p2 = value; }
|
}
|
|
[ZTImage.Reflection.UnSerializedAttribute]
|
public Int32 X1
|
{
|
get { return p1.X; }
|
set { p1.X = value; }
|
}
|
|
[ZTImage.Reflection.UnSerializedAttribute]
|
public Int32 X2
|
{
|
get { return p2.X; }
|
set { p2.X = value; }
|
}
|
|
[ZTImage.Reflection.UnSerializedAttribute]
|
public Int32 Y1
|
{
|
get { return p1.Y; }
|
set { p1.Y = value; }
|
}
|
|
[ZTImage.Reflection.UnSerializedAttribute]
|
public Int32 Y2
|
{
|
get { return p2.Y; }
|
set { p2.Y = value; }
|
}
|
|
public static bool operator !=(ZTLinePoint a, ZTLinePoint b)
|
{
|
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)))
|
{
|
return true;
|
}
|
return false;
|
}
|
}
|
}
|