Class Rect
This is a simple, half-internal helper class for handling
Rectangles (e.g. used for bounding boxes). If you are looking for
a rectangular figure object, PolyBox is your friend.
A Rect object has the properties x1, x2, y1, y2 carrying
the coordinates, and accessor functions width(), height(),
upperLeft(), lowerRight(), center(), size(). (The latter
return pairs of coordinates.)
A special facility is the __call__ operator for adding
points/rects (sort of a UNION operation).
Finally, it is possible to do:
x1, y1, x2, y2 = someRect
|
|
__init__(self,
*args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
|
|
|
|
contains(self,
other)
Return True iff other is a Rect or point that is entirely
within this Rect. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__iter__(self)
Make Rect objects assignable like::
x1, y1, x2, y2 = someRect |
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__
|
|
|
x1
|
|
|
x2
|
|
|
y1
|
|
|
y2
|
|
Inherited from object:
__class__
|
__init__(self,
*args)
(Constructor)
|
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
- Overrides:
object.__init__
- (inherited documentation)
|
Return True iff other is a Rect or point that is entirely
within this Rect. (Points on the border are considered to be
contained.)
|
__repr__(self)
(Representation operator)
|
|
repr(x)
- Overrides:
object.__repr__
- (inherited documentation)
|
__str__(self)
(Informal representation operator)
|
|
str(x)
- Overrides:
object.__str__
- (inherited documentation)
|