Package topo :: Package base :: Module boundingregion :: Class BoundingBox
[hide private]
[frames] | no frames]

Class BoundingBox

source code


A rectangular bounding box defined either by two points forming an axis-aligned rectangle (or simply a radius for a square).
Instance Methods [hide private]
 
__str__(self)
Return BoundingBox(points=((left,bottom),(right,top)))
source code
 
__repr__(self)
x.__repr__() <==> repr(x)
source code
 
script_repr(self, imports=[], prefix=' ') source code
 
__init__(self, **args)
Create a BoundingBox.
source code
 
contains(self, x, y)
Returns true if the given point is contained within the bounding box, where all boundaries of the box are considered to be inclusive.
source code
 
contains_exclusive(self, x, y)
Return True if the given point is contained within the bounding box, where the bottom and right boundaries are considered exclusive.
source code
 
containsbb_exclusive(self, x)
Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive.
source code
 
containsbb_inclusive(self, x)
Returns true if the given BoundingBox x is contained within the bounding box, including cases of exact match.
source code
 
upperexclusive_contains(self, x, y)
Returns true if the given point is contained within the bounding box, where the right and upper boundaries are exclusive, and the left and lower boundaries are inclusive.
source code
 
aarect(self) source code
 
lbrt(self)
return left,bottom,right,top values for the BoundingBox.
source code

Inherited from BoundingRegion: __getstate__, __setstate__, centroid, rotate, scale, set, translate

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from BoundingRegion (private): _aarect

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 

Return BoundingBox(points=((left,bottom),(right,top)))

Reimplemented here so that 'print' for a BoundingBox will display the bounds.

Overrides: object.__str__

__repr__(self)
(Representation operator)

source code 
x.__repr__() <==> repr(x)
Overrides: object.__repr__
(inherited documentation)

__init__(self, **args)
(Constructor)

source code 

Create a BoundingBox.

Either 'radius' or 'points' can be specified for the AARectangle.

If radius is passed in, the BoundingBox will use min_radius (which defaults to 0.0) if it's larger than radius - so by passing min_radius=1.25/density, a BoundingBox of at least 3x3 matrix units can be guaranteed.

If neither radius nor points is passed in, create a default AARectangle defined by (-0.5,-0.5),(0.5,0.5).

Overrides: object.__init__

contains(self, x, y)

source code 
Returns true if the given point is contained within the bounding box, where all boundaries of the box are considered to be inclusive.
Overrides: BoundingRegion.contains

upperexclusive_contains(self, x, y)

source code 
Returns true if the given point is contained within the bounding box, where the right and upper boundaries are exclusive, and the left and lower boundaries are inclusive. Useful for tiling a plane into non-overlapping regions.

aarect(self)

source code 
Overrides: BoundingRegion.aarect