public ShapePath.FlagsAndCommand vertex(out double x, out double y)
        {
            x = 0;
            y = 0;
            ShapePath.FlagsAndCommand command = ShapePath.FlagsAndCommand.CommandStop;
            bool done = false;

            while (!done)
            {
                switch (m_status)
                {
                case status.initial:
                    markers.remove_all();
                    m_last_cmd = VertexSource.vertex(out m_start_x, out m_start_y);
                    m_status   = status.accumulate;
                    goto case status.accumulate;

                case status.accumulate:
                    if (ShapePath.is_stop(m_last_cmd))
                    {
                        return(ShapePath.FlagsAndCommand.CommandStop);
                    }

                    generator.RemoveAll();
                    generator.AddVertex(m_start_x, m_start_y, ShapePath.FlagsAndCommand.CommandMoveTo);
                    markers.add_vertex(m_start_x, m_start_y, ShapePath.FlagsAndCommand.CommandMoveTo);

                    for (; ;)
                    {
                        command = VertexSource.vertex(out x, out y);
                        //DebugFile.Print("x=" + x.ToString() + " y=" + y.ToString() + "\n");
                        if (ShapePath.is_vertex(command))
                        {
                            m_last_cmd = command;
                            if (ShapePath.is_move_to(command))
                            {
                                m_start_x = x;
                                m_start_y = y;
                                break;
                            }
                            generator.AddVertex(x, y, command);
                            markers.add_vertex(x, y, ShapePath.FlagsAndCommand.CommandLineTo);
                        }
                        else
                        {
                            if (ShapePath.is_stop(command))
                            {
                                m_last_cmd = ShapePath.FlagsAndCommand.CommandStop;
                                break;
                            }
                            if (ShapePath.is_end_poly(command))
                            {
                                generator.AddVertex(x, y, command);
                                break;
                            }
                        }
                    }
                    generator.Rewind(0);
                    m_status = status.generate;
                    goto case status.generate;

                case status.generate:
                    command = generator.Vertex(ref x, ref y);
                    //DebugFile.Print("x=" + x.ToString() + " y=" + y.ToString() + "\n");
                    if (ShapePath.is_stop(command))
                    {
                        m_status = status.accumulate;
                        break;
                    }
                    done = true;
                    break;
                }
            }
            return(command);
        }