Пример #1
0
        public Polygon Split(VertexInterface b)
        {
            VertexInterface bp = this._v.Split(b);

            Resize();
            return(new Polygon(bp));
        }
Пример #2
0
        public void Remove()
        {
            VertexInterface v = this._v;

            this._v = (--this._size == 0) ? null : this._v.Ccw();
            v.Remove();
        }
Пример #3
0
 public VertexInterface Insert(PointInterface p)
 {
     if (this._size++ == 0)
     {
         this._v = new Vertex(p);
     }
     else
     {
         this._v = this._v.Insert(new Vertex(p));
     }
     return(this._v);
 }
Пример #4
0
 protected override void OnDisposing()
 {
     if (this._v != null)
     {
         VertexInterface w = this._v.Cw();
         while (!this._v.Equals(w))
         {
             w.Remove();
             w = this._v.Cw();
         }
         this._v = null;
     }
 }
Пример #5
0
 private void Resize()
 {
     if (this._v == null)
     {
         this._size = 0;
     }
     else
     {
         VertexInterface v = this._v.Cw();
         for (this._size = 1; !v.Equals(this._v); this._size++, v = v.Cw())
         {
             ;
         }
     }
 }
Пример #6
0
 public Polygon(Polygon p)
 {
     this._size = p._size;
     if (this._size == 0)
     {
         this._v = null;
     }
     else
     {
         this._v = new Vertex((VertexInterface)p.Point());
         for (int i = 1; i < this._size; i++)
         {
             p.Advance(Rotation.CLOCKWISE);
             this._v = this._v.Insert(new Vertex((VertexInterface)p.Point()));
         }
         p.Advance(Rotation.CLOCKWISE);
         this._v = this._v.Cw();
     }
 }
Пример #7
0
 public VertexNode(VertexInterface vertex)
 {
     this.Vertex = vertex;
 }
Пример #8
0
 public VertexInterface SetV(VertexInterface v)
 {
     return(this._v = v);
 }
Пример #9
0
 public VertexInterface Advance(Rotation rotation)
 {
     return(this._v = this._v.Neighbor(rotation));
 }
Пример #10
0
 public Polygon(VertexInterface v)
 {
     this._v = new Vertex(v);
     Resize();
 }
Пример #11
0
 public Polygon()
 {
     this._v    = null;
     this._size = 0;
 }