other
contained within self
?var a = new Box[Int].lbwh(1, 1, 4, 4)
var b = new Box[Int].lbwh(2, 2, 2, 2)
var c = new Box[Int].lbwh(0, 2, 8, 2)
assert a.contains(b)
assert not b.contains(a)
assert c.contains(b)
assert not b.contains(c)
assert not a.contains(c)
assert not c.contains(a)
# Is `other` contained within `self`?
#
# var a = new Box[Int].lbwh(1, 1, 4, 4)
# var b = new Box[Int].lbwh(2, 2, 2, 2)
# var c = new Box[Int].lbwh(0, 2, 8, 2)
# assert a.contains(b)
# assert not b.contains(a)
# assert c.contains(b)
# assert not b.contains(c)
# assert not a.contains(c)
# assert not c.contains(a)
fun contains(other: Boxed[N]): Bool
do
return self.top >= other.top and self.bottom <= other.bottom and
self.left <= other.left and self.right >= other.right
end
lib/geometry/boxes.nit:44,2--59,4
# var a = new Box3d[Int].lbfwhd(1, 1, -1, 4, 4, 4)
# var b = new Box3d[Int].lbfwhd(2, 2, -2, 2, 2, 2)
# var c = new Box3d[Int].lbfwhd(2, 2, 0, 2, 2, 8)
# assert a.contains(b)
# assert not b.contains(a)
# assert c.contains(b)
# assert not b.contains(c)
# assert not a.contains(c)
# assert not c.contains(a)
redef fun contains(other)
do
return super and (not other isa Boxed3d[N] or
(self.front >= other.front and self.back <= other.back))
end
lib/geometry/boxes.nit:167,2--180,4