static IEnumerable <IntVector2> GetLineBoxEnclosingPoints(Box box, IBoundedLine leftLine, IBoundedLine rightLine) { return(from y in ListUtil.FromTo(box.Bottom, box.Top - 1) let rightX = (int)rightLine.X(y) from x in ListUtil.FromTo((int)leftLine.X(y), rightX) select(new IntVector2(x, y))); }
public override bool MoveNext() { if (y <= box.Top) { if (x < xRight) { x++; return(true); } y++; x = (int)Math.Ceiling(leftLine.X(y)) - 1; xRight = (int)Math.Floor(rightLine.X(y)); return(MoveNext()); } return(false); }