Package horizons :: Package util :: Package shapes :: Module rect :: Class ConstRect
[hide private]
[frames] | no frames]

Class ConstRect

source code

python.Const --+
               |
   Shape --+   |
           |   |
        Rect --+
               |
              ConstRect

An immutable Rect. Can be used for manual const-only optimization

Instance Methods [hide private]
    Inherited from Rect
 
__contains__(self, point) source code
 
__eq__(self, other) source code
 
__hash__(self) source code
 
__init__(self, *args) source code
 
__lt__(self, other) source code
 
__ne__(self, other) source code
 
__str__(self) source code
 
center(self)
Returns the center point of the rect.
source code
 
contains(self, point)
Returns if this rect (self) contains the point.
source code
 
contains_tuple(self, tup)
Same as contains, but takes a tuple (x, y) as parameter (overloaded function)
source code
 
contains_without_border(self, point)
Same as contains, see iter_without_border for difference
source code
 
copy(self) source code
 
get_corners(self)
Returns corners of rect in this order: topleft topright bottomright bottomleft
source code
 
get_radius_coordinates(self, radius, include_self=False)
Returns list of all coordinates (as tuples), that are in the radius This is a generator.
source code
 
get_surrounding(self, include_corners=True)
Returns neighboring coords of the rect.
source code
 
height(self) source code
 
intersect(self, rect)
Returns a rect that is the intersection of this rect and the rect parameter.
source code
 
intersects(self, rect)
Returns if the rectangle intersects with the rect parameter.
source code
 
iter_without_border(self)
There are 2 possible interpretations about what *width* means.
source code
 
tuple_iter(self)
Generates an iterator, that returns tuples
source code
 
width(self) source code
    Inherited from Shape
 
__iter__(self)
Return all coordinates in the shape as points.
source code
 
distance(self, other) source code
 
get_coordinates(self)
Return all coordinates in the shape.
source code
 
get_distance_function(self, other) source code
Class Methods [hide private]
    Inherited from Rect
 
get_surrounding_offsets(cls, size) source code
 
init_from_borders(cls, left, top, right, bottom) source code
 
init_from_corners(cls, point1, point2)
Init rect with 2 points interpreted as 2 corner points
source code
 
init_from_topleft_and_size(cls, x, y, width, height) source code
 
init_from_topleft_and_size_tuples(cls, coords, size) source code