Ejemplo n.º 1
0
    xmin1, xmax1 = b1.intervalx().get_bounds()
    ymin1, ymax1 = b1.intervaly().get_bounds()
    xmin2, xmax2 = b2.intervalx().get_bounds()
    ymin2, ymax2 = b2.intervaly().get_bounds()

    pairs = ( (xmin1, xmin2), (xmax1, xmax2), (ymin1, ymin2), (ymax1, ymax2))
    return alltrue([closeto(x,y) for x,y in pairs])
    
ll = Point( Value(10),  Value(10) )
ur = Point( Value(200), Value(40) )

bbox = Bbox(ll, ur)

assert(bbox.xmin()==10)
assert(bbox.width()==190)
assert(bbox.height()==30)

ll.x().set(12.0)
assert(bbox.xmin()==12)
assert(bbox.width()==188)
assert(bbox.height()==30)


a  = Value(10)
b  = Value(0)
c  = Value(0)
d  = Value(20)
tx = Value(-10)
ty = Value(-20)

affine = Affine(a,b,c,d,tx,ty)
Ejemplo n.º 2
0
    ymin1, ymax1 = b1.intervaly().get_bounds()
    xmin2, xmax2 = b2.intervalx().get_bounds()
    ymin2, ymax2 = b2.intervaly().get_bounds()

    pairs = ((xmin1, xmin2), (xmax1, xmax2), (ymin1, ymin2), (ymax1, ymax2))
    return alltrue([closeto(x, y) for x, y in pairs])


ll = Point(Value(10), Value(10))
ur = Point(Value(200), Value(40))

bbox = Bbox(ll, ur)

assert (bbox.xmin() == 10)
assert (bbox.width() == 190)
assert (bbox.height() == 30)

ll.x().set(12.0)
assert (bbox.xmin() == 12)
assert (bbox.width() == 188)
assert (bbox.height() == 30)

a = Value(10)
b = Value(0)
c = Value(0)
d = Value(20)
tx = Value(-10)
ty = Value(-20)

affine = Affine(a, b, c, d, tx, ty)
# test transformation of xy tuple