Ejemplo n.º 1
0
        private Polygon2D BuildPolygon()
        {
            Polygon2D       polygon       = new Polygon2D();
            Polygon2DEditor polygonEditor = new Polygon2DEditor(polygon);
            int             j             = 0;

            for (int i = 0; i < this.indices.Length; i++)
            {
                this.points[j].Y = this.Reverse - this.points[j].Y + XWFParser.Margin;
                polygonEditor.AddPoint(this.points[j]);
                j = this.indices[j];
            }

            return(polygon);
        }
Ejemplo n.º 2
0
        public void FromString(string polygonString)
        {
            string[] str = polygonString.Split('|');

            string[] s = str[0].Split('#');

            for (int j = 0; j < s.Length; j++)
            {
                Polygon2DEditor polygonEditor = new Polygon2DEditor(this.FirstPolygon);

                polygonEditor.AddPoint(ConvertPoint2DFromString(s[j]));
            }

            s = str[1].Split('#');

            for (int j = 0; j < s.Length; j++)
            {
                Polygon2DEditor polygonEditor = new Polygon2DEditor(this.LastPolygon);

                polygonEditor.AddPoint(ConvertPoint2DFromString(s[j]));
            }
        }