PixelFarm.Agg.VertexSource.Arc.Init C# (CSharp) Method

Init() public method

public Init ( double ox, double oy, double rx, double ry, double angle1, double angle2 ) : void
ox double
oy double
rx double
ry double
angle1 double
angle2 double
return void
        public void Init(double ox, double oy,
                  double rx, double ry,
                  double angle1, double angle2)
        {
            Init(ox, oy, rx, ry, angle1, angle2, ArcDirection.CounterClockWise);
        }

Same methods

Arc::Init ( double ox, double oy, double rx, double ry, double angle1, double angle2, ArcDirection direction ) : void

Usage Example

Example #1
0
        IEnumerable <VertexData> GetVertexIter()
        {
            currentProcessingArc.UseStartEndLimit = true;
            currentProcessingArc.Init(bounds.Left + leftBottomRadius.x, bounds.Bottom + leftBottomRadius.y, leftBottomRadius.x, leftBottomRadius.y, Math.PI, Math.PI + Math.PI * 0.5);
            currentProcessingArc.SetStartEndLimit(bounds.Left, bounds.Bottom + leftBottomRadius.y,
                                                  bounds.Left + leftBottomRadius.x, bounds.Bottom);
            foreach (VertexData vertexData in currentProcessingArc.GetVertexIter())
            {
                if (VertexHelper.IsEmpty(vertexData.command))
                {
                    break;
                }
                yield return(vertexData);
            }


            currentProcessingArc.Init(bounds.Right - rightBottomRadius.x, bounds.Bottom + rightBottomRadius.y, rightBottomRadius.x, rightBottomRadius.y, Math.PI + Math.PI * 0.5, 0.0);
            currentProcessingArc.SetStartEndLimit(bounds.Right - rightBottomRadius.x,
                                                  bounds.Bottom, bounds.Right, bounds.Bottom + rightBottomRadius.y);
            foreach (VertexData vertexData in currentProcessingArc.GetVertexIter())
            {
                if (VertexHelper.IsMoveTo(vertexData.command))
                {
                    // skip the initial moveto
                    continue;
                }
                if (VertexHelper.IsEmpty(vertexData.command))
                {
                    break;
                }
                yield return(vertexData);
            }


            currentProcessingArc.Init(bounds.Right - rightTopRadius.x, bounds.Top - rightTopRadius.y, rightTopRadius.x, rightTopRadius.y, 0.0, Math.PI * 0.5);
            currentProcessingArc.SetStartEndLimit(bounds.Right, bounds.Top - rightTopRadius.y,
                                                  bounds.Right - rightTopRadius.x, bounds.Top);
            foreach (VertexData vertexData in currentProcessingArc.GetVertexIter())
            {
                if (VertexHelper.IsMoveTo(vertexData.command))
                {
                    // skip the initial moveto
                    continue;
                }
                if (VertexHelper.IsEmpty(vertexData.command))
                {
                    break;
                }
                yield return(vertexData);
            }


            currentProcessingArc.Init(bounds.Left + leftTopRadius.x, bounds.Top - leftTopRadius.y, leftTopRadius.x, leftTopRadius.y, Math.PI * 0.5, Math.PI);
            currentProcessingArc.SetStartEndLimit(bounds.Left - leftTopRadius.x, bounds.Top,
                                                  bounds.Left, bounds.Top - leftTopRadius.y);
            foreach (VertexData vertexData in currentProcessingArc.GetVertexIter())
            {
                switch (vertexData.command)
                {
                case VertexCmd.MoveTo:
                    continue;

                case VertexCmd.NoMore:
                    break;

                default:
                    yield return(vertexData);

                    break;
                }
            }

            yield return(new VertexData(VertexCmd.Close, (int)EndVertexOrientation.CCW, 0));

            yield return(new VertexData(VertexCmd.NoMore));
        }
All Usage Examples Of PixelFarm.Agg.VertexSource.Arc::Init