GetVertexIter() публичный Метод

public GetVertexIter ( ) : IEnumerable
Результат IEnumerable
Пример #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));
        }