public void TestFindRoutingSlotBottom2() { List <Rect> rectangles = new List <Rect>() { new Rect() { X = 10, Y = 10, Height = 150, Width = 100 }, new Rect() { X = 30, Y = 200, Height = 50, Width = 100 }, new Rect() { X = 50, Y = 70, Height = 50, Width = 100 }, new Rect() { X = 200, Y = 10, Height = 50, Width = 100 }, }; var ra = new RoutingAssistent(); ra.InitalizeBoundSearchStructures(rectangles); var r = ra.FindHorizontalRoutingSlotBottom(rectangles[2].Bottom + 1, rectangles[0].X, rectangles[3].X); Assert.IsTrue(r > 160 && r < 200); }
public void TestFindRoutingSlotLeft1() { List <Rect> rectangles = new List <Rect>() { new Rect() { X = 10, Y = 10, Height = 50, Width = 100 }, new Rect() { X = 30, Y = 200, Height = 50, Width = 100 }, new Rect() { X = 50, Y = 70, Height = 50, Width = 100 }, new Rect() { X = 200, Y = 10, Height = 50, Width = 100 }, }; var ra = new RoutingAssistent(); ra.InitalizeBoundSearchStructures(rectangles); var r = ra.FindVerticalRoutingSlotLeft(rectangles[3].Left - 1, rectangles[0].Y, rectangles[1].Y); Assert.IsTrue(r <= 200 && r > 150); }
public void TestFindRoutingSlotTop2() { List <Rect> rectangles = new List <Rect>() { new Rect() { X = 10, Y = 10, Height = 50, Width = 100 }, new Rect() { X = 30, Y = 200, Height = 50, Width = 100 }, new Rect() { X = 50, Y = 150, Height = 50, Width = 100 }, new Rect() { X = 200, Y = 10, Height = 50, Width = 100 }, }; var ra = new RoutingAssistent(); ra.InitalizeBoundSearchStructures(rectangles); var r = ra.FindHorizontalRoutingSlotTop(rectangles[1].Top - 1, rectangles[0].X, rectangles[3].X); Assert.IsTrue(r <= 150 && r > 60); }