Exemplo n.º 1
0
 public Polygon([NotNull] PolyLine edge, IEnumerable <PolyLine> holes = null)
 {
     _lines = new List <PolyLine>();
     AddEdge(edge);
     if (holes != null)
     {
         foreach (var hole in holes)
         {
             AddHole(hole);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加洞
 /// </summary>
 /// <param name="line"></param>
 public void AddHole(PolyLine line)
 {
     line.SafeCloseLine();
     line.Counterclockwise();
     _lines.Add(line);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 添加边界
 /// </summary>
 /// <param name="line"></param>
 public void AddEdge(PolyLine line)
 {
     line.SafeCloseLine();
     line.Clockwise();
     _lines.Add(line);
 }
Exemplo n.º 4
0
 public Polygon([NotNull] PolyLine edge, params PolyLine[] holes) : this(edge, holes.ToList())
 {
 }