Exemplo n.º 1
0
            public override IEnumerable <SimpleSegment> GetSimpleSegments()
            {
                var start = Start;
                // ReSharper disable once GenericEnumeratorNotDisposed
                var enumerator = _segment.Points.GetEnumerator();

                while (enumerator.MoveNext())
                {
                    var current = enumerator.Current;
                    yield return(SimpleSegment.Create(start, current));

                    start = current;
                }
            }
Exemplo n.º 2
0
        private IEnumerable <SimpleSegment> GetEffectiveSegments(PathFigure pathFigure)
        {
            var startPoint = pathFigure.StartPoint;

            foreach (var iteratorVariable1 in pathFigure.AllSegments())
            {
                foreach (var iteratorVariable2 in iteratorVariable1.PathSegment.GetSimpleSegments(
                             iteratorVariable1.StartPoint))
                {
                    yield return(iteratorVariable2);

                    startPoint = iteratorVariable2.Points.Last();
                }
            }

            if (pathFigure.IsClosed)
            {
                yield return(SimpleSegment.Create(startPoint, pathFigure.StartPoint));
            }
        }
Exemplo n.º 3
0
            public override IEnumerable <SimpleSegment> GetSimpleSegments()
            {
                var           start             = Start;
                IList <Point> points            = _segment.Points;
                var           iteratorVariable2 = _segment.Points.Count / 2;
                var           iteratorVariable3 = 0;

                while (true)
                {
                    if (iteratorVariable3 >= iteratorVariable2)
                    {
                        yield break;
                    }
                    var iteratorVariable4 = iteratorVariable3 * 2;
                    yield return(SimpleSegment.Create(start, points[iteratorVariable4],
                                                      points[iteratorVariable4 + 1]));

                    start = points[iteratorVariable4 + 1];
                    iteratorVariable3++;
                }
            }
Exemplo n.º 4
0
 public override IEnumerable <SimpleSegment> GetSimpleSegments()
 {
     yield return(SimpleSegment.Create(Start, _segment.Point1, _segment.Point2));
 }