Exemple #1
0
        public Polygon Split(VertexInterface b)
        {
            VertexInterface bp = this._v.Split(b);

            Resize();
            return(new Polygon(bp));
        }
Exemple #2
0
        public void Remove()
        {
            VertexInterface v = this._v;

            this._v = (--this._size == 0) ? null : this._v.Ccw();
            v.Remove();
        }
Exemple #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);
 }
Exemple #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;
     }
 }
Exemple #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())
         {
             ;
         }
     }
 }
Exemple #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();
     }
 }
Exemple #7
0
 public VertexNode(VertexInterface vertex)
 {
     this.Vertex = vertex;
 }
Exemple #8
0
 public VertexInterface SetV(VertexInterface v)
 {
     return(this._v = v);
 }
Exemple #9
0
 public VertexInterface Advance(Rotation rotation)
 {
     return(this._v = this._v.Neighbor(rotation));
 }
Exemple #10
0
 public Polygon(VertexInterface v)
 {
     this._v = new Vertex(v);
     Resize();
 }
Exemple #11
0
 public Polygon()
 {
     this._v    = null;
     this._size = 0;
 }