public static void SendShapeToTesselator(VertexTesselatorAbstract tesselator, IEnumerable <VertexData> vertexSource)
        {
#if !DEBUG
            try
#endif
            {
                tesselator.BeginPolygon();

                bool haveBegunContour = false;
                foreach (var vertexData in vertexSource)
                {
                    if (vertexData.IsStop)
                    {
                        break;
                    }

                    if (haveBegunContour &&
                        (vertexData.IsClose || vertexData.IsMoveTo))
                    {
                        tesselator.EndContour();
                        haveBegunContour = false;
                    }

                    if (!vertexData.IsClose)
                    {
                        if (!haveBegunContour)
                        {
                            tesselator.BeginContour();
                            haveBegunContour = true;
                        }

                        tesselator.AddVertex(vertexData.position.X, vertexData.position.Y);
                    }
                }

                if (haveBegunContour)
                {
                    tesselator.EndContour();
                }

                tesselator.EndPolygon();
            }
#if !DEBUG
            catch
            {
            }
#endif
        }
        public static void SendShapeToTesselator(VertexTesselatorAbstract tesselator, IVertexSource vertexSource)
        {
#if !DEBUG
            try
#endif
            {
                tesselator.BeginPolygon();

                ShapePath.FlagsAndCommand PathAndFlags = 0;
                double x, y;
                bool haveBegunContour = false;
                while (!ShapePath.is_stop(PathAndFlags = vertexSource.vertex(out x, out y)))
                {
                    if (ShapePath.is_close(PathAndFlags)
                        || (haveBegunContour && ShapePath.is_move_to(PathAndFlags)))
                    {
                        tesselator.EndContour();
                        haveBegunContour = false;
                    }

                    if (!ShapePath.is_close(PathAndFlags))
                    {
                        if (!haveBegunContour)
                        {
                            tesselator.BeginContour();
                            haveBegunContour = true;
                        }

                        tesselator.AddVertex(x, y);
                    }
                }

                if (haveBegunContour)
                {
                    tesselator.EndContour();
                }

                tesselator.EndPolygon();
            }
#if !DEBUG
            catch
            {
            }
#endif
        }
 public static void SendShapeToTesselator(VertexTesselatorAbstract tesselator, IVertexSource vertexSource)
 {
     SendShapeToTesselator(tesselator, vertexSource.Vertices());
 }