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; } }
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)); } }
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++; } }
public override IEnumerable <SimpleSegment> GetSimpleSegments() { yield return(SimpleSegment.Create(Start, _segment.Point1, _segment.Point2)); }