public Rectangles intersectingRects(Rectangle r) { Rectangles tmp = new Rectangles(); foreach (Rectangle rInList in list) { if (rInList.Intersect(r)) { tmp.list.Add(rInList);//on bypass le test déjà fait a l'ajout intial du rect dans la liste } } return(tmp); }
/// <summary> /// Return rectangles with size smaller than r.size /// </summary> public Rectangles SmallerRects(Rectangle r) { Rectangles tmp = new Rectangles(); foreach (Rectangle rInList in list) { if (rInList.Size < r.Size) { tmp.list.Add(rInList); } } return(tmp); }
public Rectangles SmallerContainedRects(Rectangle r) { Rectangles tmp = new Rectangles(); foreach (Rectangle rInList in list) { if (r.ContainsOrIsEqual(rInList) && rInList.Size < r.Size) { tmp.list.Add(rInList); } } return(tmp); }
public Rectangles containedOrEqualRects(Rectangle r) { Rectangles tmp = new Rectangles(); foreach (Rectangle rInList in list) { if (r.ContainsOrIsEqual(rInList)) // && rInList.Size <= r.Size) { tmp.list.Add(rInList); } } return(tmp); }