Ejemplo n.º 1
0
        public GeomVertexList(IPointCollection pColl)
        {
            pColl = Algorithm.RemoveDoubles(pColl);
            if (Algorithm.IsSelfIntersecting(pColl))
            {
                return;
            }

            NofVertices = pColl.PointCount;

            if (NofVertices > 1)
            {
                if (pColl[0].X != pColl[NofVertices - 1].X ||
                    pColl[0].Y != pColl[NofVertices - 1].Y)
                {
                    NofVertices++;
                }
            }

            Vertex = new GeomVertex[NofVertices];
            for (int i = 0; i < pColl.PointCount; i++)
            {
                Vertex[i] = new GeomVertex(pColl[i].X, pColl[i].Y);
            }

            if (NofVertices == pColl.PointCount + 1)
            {
                Vertex[NofVertices - 1] = new GeomVertex(pColl[0].X, pColl[0].Y);
            }
        }
Ejemplo n.º 2
0
 public GeomVertexList(PointF[] p)
 {
     NofVertices = p.Length;
     Vertex      = new GeomVertex[NofVertices];
     for (int i = 0; i < p.Length; i++)
     {
         Vertex[i] = new GeomVertex((double)p[i].X, (double)p[i].Y);
     }
 }