Example #1
0
        public VertexStore MakeVxs(VertexStore sourceVxs, VertexStore vxs)
        {
            StrokeGenerator strkgen = _strokeGen;
            int             j       = sourceVxs.Count;

            strkgen.Reset();
            //
            //
            VertexCmd cmd;
            double    x = 0, y = 0, startX = 0, startY = 0;

            for (int i = 0; i < j; ++i)
            {
                cmd = sourceVxs.GetVertex(i, out x, out y);
                switch (cmd)
                {
                case VertexCmd.NoMore:
                    break;

                case VertexCmd.Close:
                case VertexCmd.CloseAndEndFigure:

                    strkgen.AddVertex(x, y, cmd);
                    if (i < j - 2)
                    {
                        strkgen.AddVertex(startX, startY, VertexCmd.LineTo);
                        strkgen.WriteTo(vxs);
                        strkgen.Reset();
                    }
                    //end this polygon

                    break;

                case VertexCmd.LineTo:
                case VertexCmd.P2c:    //user must flatten the curve before do stroke
                case VertexCmd.P3c:    //user must flatten the curve before do stroke

                    strkgen.AddVertex(x, y, cmd);

                    break;

                case VertexCmd.MoveTo:

                    strkgen.AddVertex(x, y, cmd);
                    startX = x;
                    startY = y;

                    break;

                default: throw new System.NotSupportedException();
                }
            }
            strkgen.WriteTo(vxs);
            strkgen.Reset();

            return(vxs);
        }
Example #2
0
 public Stroke(double inWidth)
 {
     this._strokeGen = new StrokeGenerator();
     this.Width      = inWidth;
 }
Example #3
0
 public Stroke(double inWidth)
 {
     this.strokeGen = new StrokeGenerator();
     this.Width = inWidth;
 }