asmrobot
2019-11-21 589ed88a5924a7494e21b95b6bbff5e46ff49ddd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using RichCreator.Utility.Utilitys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace RichCreator.Utility.Structs
{
    /// <summary>
    /// 线
    /// </summary>
    public struct ZTLinePoint:IEquatable<ZTLinePoint>
    {
        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;
        }
    }
}