예제 #1
0
        public void JoinPath(PathStorage <T> vs, uint path_id)
        {
            T x, y;

            vs.Rewind(path_id);
            uint PathAndFlags = vs.Vertex(out x, out y);

            if (!Path.IsStop(PathAndFlags))
            {
                if (Path.IsVertex(PathAndFlags))
                {
                    T    x0, y0;
                    uint PathAndFlags0 = LastVertex(out x0, out y0);
                    if (Path.IsVertex(PathAndFlags0))
                    {
                        if (MathUtil.CalcDistance(x, y, x0, y0).GreaterThan(MathUtil.VertexDistEpsilon))
                        {
                            if (Path.IsMoveTo(PathAndFlags))
                            {
                                PathAndFlags = (uint)Path.Commands.LineTo;
                            }
                            m_vertices.AddVertex(x, y, PathAndFlags);
                        }
                    }
                    else
                    {
                        if (Path.IsStop(PathAndFlags0))
                        {
                            PathAndFlags = (uint)Path.Commands.MoveTo;
                        }
                        else
                        {
                            if (Path.IsMoveTo(PathAndFlags))
                            {
                                PathAndFlags = (uint)Path.Commands.LineTo;
                            }
                        }
                        m_vertices.AddVertex(x, y, PathAndFlags);
                    }
                }
                while (!Path.IsStop(PathAndFlags = vs.Vertex(out x, out y)))
                {
                    m_vertices.AddVertex(x, y, Path.IsMoveTo(PathAndFlags) ?
                                         (uint)Path.Commands.LineTo :
                                         PathAndFlags);
                }
            }
        }
예제 #2
0
 //--------------------------------------------------------------------
 // Join path. The path is joined with the existing one, that is,
 // it behaves as if the pen of a plotter was always down (drawing)
 //template<class VertexSource>
 public void JoinPath(PathStorage <T> vs)
 {
     JoinPath(vs, 0);
 }