Package gavo :: Package base :: Module coords :: Class Box
[frames] | no frames]

Class Box

source code

object --+
         |
        Box

is a 2D box.

The can be constructed either with two tuples, giving two points delimiting the box, or with four arguments x0, x1, y0, y1.

To access the thing, you can either access the x[01], y[01] attributes or use getitem to retrieve the upper right and lower left corner.

The slightly silly ordering of the bounding points (larger values first) is for consistency with Postgresql.

Instance Methods
 
__init__(self, x0, x1, y0=None, y1=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__getitem__(self, index) source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, x0, x1, y0=None, y1=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)