def testLowerRight(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (12, 5),(25, 15) ) ) self.failIf(B.Inside(C) )
def testLowerLeft(self): B = BBox(((5, 10), (15, 25))) C = BBox(((-10, 5), (8.5, 15))) self.failUnless(B.Overlaps(C))
def testAbove(self): B = BBox(((5, 10), (15, 25))) C = BBox(((-10, 25.001), (8.5, 32))) self.failIf(B.Overlaps(C))
def testUpperLeft(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (0, 12),(10, 32.0) ) ) self.failUnless(B.Overlaps(C) )
def testCreates(self): B = BBox(((0, 0), (5, 5))) self.failUnless(isinstance(B, BBox))
def testMinMax2(self): # OK to have a zero-sized BB B = BBox(((10.0,-34),(10.0,-34.0))) self.failUnless(isinstance(B, BBox))
def testPassThrough(self): B = BBox(((0,0),(5,5))) C = asBBox(B) self.failUnless(B is C)
def testLowerLeft(self): B = BBox( ( (5, 10),(15, 25) ) ) P = (-10, 5) self.failIf(B.PointInside(P))
def testBelow(self): B = BBox( ( (5, 10),(15, 25) ) ) P = (10, 5) self.failIf(B.PointInside(P))
def testPointIn(self): B = BBox( ( (1.0, 2.0), (5.0, 10.0) ) ) P = (3.0, 4.0) self.failUnless(B.PointInside(P))
def testLowerRight(self): B = BBox( ( (5, 10),(15, 25) ) ) P = (16, 4) self.failIf(B.PointInside(P))
def testRight(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (17.1, 8),(17.95, 32) ) ) self.failIf(B.Inside(C) )
def testLeft(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (4, 8),(4.95, 32) ) ) self.failIf(B.Inside(C) )
def testLowerLeft(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (-10, 5),(8.5, 15) ) ) self.failIf(B.Inside(C) )
def testPointOnBottomRight(self): B = BBox( ( (-10.0, -10.0), (-1.0, -1.0) ) ) P = (-1, -10.0) self.failUnless(B.PointInside(P))
def testAbove(self): B = BBox( ( (5, 10),(15, 25) ) ) P = ( 10, 25.001) self.failIf(B.PointInside(P))
def testMinMax(self): # OK to have a zero-sized BB B = BBox(((0,0),(0,5))) self.failUnless(isinstance(B, BBox))
def testLeft(self): B = BBox( ( (5, 10),(15, 25) ) ) P = (4, 12) self.failIf(B.PointInside(P))
def testMinMax3(self): # OK to have a tiny BB B = BBox(((0,0),(1e-20,5))) self.failUnless(isinstance(B, BBox))
def testRight(self): B = BBox( ( (5, 10),(15, 25) ) ) P = (17.1, 12.3) self.failIf(B.PointInside(P))
def testSame(self): B = BBox(((-23.5, 456),(56, 532.0))) C = BBox(((-23.5, 456),(56, 532.0))) self.failUnless(B.Overlaps(C) )
def testArrayConstruction(self): A = N.array(((4,5),(10,12)), N.float_) B = BBox(A) self.failUnless(isinstance(B, BBox))
def testUpperRight(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (12, 12),(25, 32.0) ) ) self.failUnless(B.Overlaps(C) )
def testPointLeftTopLine(self): B = BBox( ( (1.0, 2.0), (5.0, 10.0) ) ) P = (-3.0, 10.0) self.failIf(B.PointInside(P))
def testLowerRight(self): B = BBox(((5, 10), (15, 25))) C = BBox(((12, 5), (25, 15))) self.failUnless(B.Overlaps(C))
def testPointOnBottomLine(self): B = BBox( ( (1.0, 2.0), (5.0, 10.0) ) ) P = (3.0, 5.0) self.failUnless(B.PointInside(P))
def testBelow(self): B = BBox(((5, 10), (15, 25))) C = BBox(((-10, 5), (8.5, 9.2))) self.failIf(B.Overlaps(C))
def testPointOnLeft(self): B = BBox( ( (-10.0, -10.0), (-1.0, -1.0) ) ) P = (-10, -5.0) self.failUnless(B.PointInside(P))
def testLeft(self): B = BBox(((5, 10), (15, 25))) C = BBox(((4, 8), (4.95, 32))) self.failIf(B.Overlaps(C))
def testUpperRight(self): B = BBox( ( (5, 10),(15, 25) ) ) C = BBox( ( (12, 12),(25, 32.0) ) ) self.failIf(B.Inside(C) )