Пример #1
0
        public virtual void ModifyPath(PathConstructionRenderInfo renderInfo)
        {
            // See the comment on the newClippingPath field.
            if (newClippingPath.IsEmpty())
            {
                return;
            }

            IList <float> segmentData = renderInfo.SegmentData;

            switch (renderInfo.Operation)
            {
            case PathConstructionRenderInfo.MOVETO:
                unfilteredCurrentPath.MoveTo(segmentData[0], segmentData[1]);
                break;

            case PathConstructionRenderInfo.LINETO:
                unfilteredCurrentPath.LineTo(segmentData[0], segmentData[1]);
                break;

            case PathConstructionRenderInfo.CURVE_123:
                unfilteredCurrentPath.CurveTo(segmentData[0], segmentData[1], segmentData[2],
                                              segmentData[3], segmentData[4], segmentData[5]);
                break;

            case PathConstructionRenderInfo.CURVE_23:
                unfilteredCurrentPath.CurveTo(segmentData[0], segmentData[1], segmentData[2], segmentData[3]);
                break;

            case PathConstructionRenderInfo.CURVE_13:
                unfilteredCurrentPath.CurveFromTo(segmentData[0], segmentData[1], segmentData[2], segmentData[3]);
                break;

            case PathConstructionRenderInfo.CLOSE:
                unfilteredCurrentPath.CloseSubpath();
                break;

            case PathConstructionRenderInfo.RECT:
                unfilteredCurrentPath.Rectangle(segmentData[0], segmentData[1], segmentData[2], segmentData[3]);
                break;
            }
        }
Пример #2
0
 public void ModifyPath(PathConstructionRenderInfo renderInfo)
 {
     if (renderInfo.Operation == 1)
     {
         var x      = renderInfo.SegmentData[0];
         var y      = renderInfo.SegmentData[1];
         var moveTo = new Vector(x, y, 1);
         movements.Enqueue(Tuple.Create(1, moveTo));
     }
     else if (renderInfo.Operation == 2)
     {
         var x      = renderInfo.SegmentData[0];
         var y      = renderInfo.SegmentData[1];
         var lineTo = new Vector(x, y, 1);
         movements.Enqueue(Tuple.Create(2, lineTo));
     }
     else if (renderInfo.Operation == 7)
     {
         rData = renderInfo.SegmentData;
     }
 }
Пример #3
0
        /// <summary>
        ///     Modifies the current path in pdf construction
        /// </summary>
        /// <param name="renderInfo">
        ///     Contains information relating to construction the current path.
        /// </param>
        /// We are interested only in straight lines and rectangles
        public void ModifyPath(PathConstructionRenderInfo renderInfo)
        {
            var segmentData = renderInfo.SegmentData;

            switch (renderInfo.Operation)
            {
            case PathConstructionRenderInfo.MOVETO:
                _currentPoints.Add(new LineMove {
                    X = segmentData[0], Y = segmentData[1], IsMove = true
                });
                break;

            case PathConstructionRenderInfo.LINETO:
                _currentPoints.Add(new LineMove {
                    X = segmentData[0], Y = segmentData[1], IsMove = false
                });

                break;

            case PathConstructionRenderInfo.CURVE_123:
            case PathConstructionRenderInfo.CURVE_13:
            case PathConstructionRenderInfo.CURVE_23:
                break;

            case PathConstructionRenderInfo.RECT:
                var x      = segmentData[0];
                var y      = segmentData[1];
                var width  = segmentData[2];
                var height = segmentData[3];
                _currentRectangle = new Rectangle {
                    X = x, Height = height, Width = width, Y = y
                };
                break;

            case PathConstructionRenderInfo.CLOSE:

                break;
            }
        }
Пример #4
0
        public virtual void ModifyPath(PathConstructionRenderInfo renderInfo)
        {
            IList <float> segmentData = renderInfo.SegmentData;

            switch (renderInfo.Operation)
            {
            case PathConstructionRenderInfo.MOVETO:
                unfilteredCurrentPath.MoveTo(segmentData[0], segmentData[1]);
                break;

            case PathConstructionRenderInfo.LINETO:
                unfilteredCurrentPath.LineTo(segmentData[0], segmentData[1]);
                break;

            case PathConstructionRenderInfo.CURVE_123:
                unfilteredCurrentPath.CurveTo(segmentData[0], segmentData[1], segmentData[2],
                                              segmentData[3], segmentData[4], segmentData[5]);
                break;

            case PathConstructionRenderInfo.CURVE_23:
                unfilteredCurrentPath.CurveTo(segmentData[0], segmentData[1], segmentData[2], segmentData[3]);
                break;

            case PathConstructionRenderInfo.CURVE_13:
                unfilteredCurrentPath.CurveFromTo(segmentData[0], segmentData[1], segmentData[2], segmentData[3]);
                break;

            case PathConstructionRenderInfo.CLOSE:
                unfilteredCurrentPath.CloseSubpath();
                break;

            case PathConstructionRenderInfo.RECT:
                unfilteredCurrentPath.Rectangle(segmentData[0], segmentData[1], segmentData[2], segmentData[3]);
                break;
            }
        }
 public void ModifyPath(PathConstructionRenderInfo renderInfo)
 {
     pathInfos.Add(renderInfo);
 }