コード例 #1
0
        public void join_path(VertexStorage vs, int path_id)
        {
            double x, y;

            vs.rewind(path_id);
            ShapePath.FlagsAndCommand PathAndFlags = vs.vertex(out x, out y);
            if (!ShapePath.is_stop(PathAndFlags))
            {
                if (ShapePath.is_vertex(PathAndFlags))
                {
                    double x0, y0;
                    ShapePath.FlagsAndCommand PathAndFlags0 = last_vertex(out x0, out y0);
                    if (ShapePath.is_vertex(PathAndFlags0))
                    {
                        if (agg_math.calc_distance(x, y, x0, y0) > agg_math.vertex_dist_epsilon)
                        {
                            if (ShapePath.is_move_to(PathAndFlags))
                            {
                                PathAndFlags = ShapePath.FlagsAndCommand.LineTo;
                            }
                            vertexDataManager.AddVertex(x, y, PathAndFlags);
                        }
                    }
                    else
                    {
                        if (ShapePath.is_stop(PathAndFlags0))
                        {
                            PathAndFlags = ShapePath.FlagsAndCommand.MoveTo;
                        }
                        else
                        {
                            if (ShapePath.is_move_to(PathAndFlags))
                            {
                                PathAndFlags = ShapePath.FlagsAndCommand.LineTo;
                            }
                        }
                        vertexDataManager.AddVertex(x, y, PathAndFlags);
                    }
                }
                while (!ShapePath.is_stop(PathAndFlags = vs.vertex(out x, out y)))
                {
                    vertexDataManager.AddVertex(x, y, ShapePath.is_move_to(PathAndFlags) ?
                                                ShapePath.FlagsAndCommand.LineTo :
                                                PathAndFlags);
                }
            }
        }
コード例 #2
0
        // Flip all vertices horizontally or vertically,
        // between x1 and x2, or between y1 and y2 respectively
        //--------------------------------------------------------------------
        public void flip_x(double x1, double x2)
        {
            int    i;
            double x, y;

            for (i = 0; i < vertices.total_vertices(); i++)
            {
                ShapePath.FlagsAndCommand PathAndFlags = vertices.vertex(i, out x, out y);
                if (ShapePath.is_vertex(PathAndFlags))
                {
                    vertices.modify_vertex(i, x2 - x + x1, y);
                }
            }
        }
コード例 #3
0
ファイル: PathStorage.cs プロジェクト: asmboom/PixelFarm
 public ShapePath.FlagsAndCommand vertex(int index, out double x, out double y)
 {
     return(vertices.vertex(index, out x, out y));
 }