Package igraph :: Module drawing :: Class BoundingBox
[hide private]
[frames] | no frames]

Class BoundingBox

object --+
         |
        BoundingBox

Class representing a bounding box (a rectangular area).

Instance Methods [hide private]
 
__eq__(self, other)
 
__init__(self, *args)
Creates a bounding box.
 
__ne__(self, other)
 
__repr__(self)
repr(x)
 
_get_bottom(self)
 
_get_coords(self)
Returns the coordinates of the corners.
 
_get_height(self)
 
_get_left(self)
 
_get_right(self)
 
_get_shape(self)
 
_get_top(self)
 
_get_width(self)
 
_set_coords(self, coords)
Sets the coordinates of the corners.
 
contract(self, margins)
Contracts the bounding box by the given margins.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]
  bottom
Y coordinate of the bottom of the box
  coords
Sets or returns the coordinates of the corners
  height
Gets the height of the bounding box
  left
X coordinate of the left side of the box
  right
X coordinate of the right side of the box
  shape
Gets the shape of the bounding box (width, height)
  top
Y coordinate of the top of the box
  width
Gets the width of the bounding box

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

 

Creates a bounding box.

The corners of the bounding box can be specified by either a tuple (four items, two for each corner, respectively), four separate numbers (X and Y coordinates for each corner) or two separate numbers (width and height, the upper left corner is assumed to be at (0,0))

Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

_set_coords(self, coords)

 

Sets the coordinates of the corners.

Parameters:
  • coords - a 4-tuple with the coordinates of the corners

contract(self, margins)

 

Contracts the bounding box by the given margins.

Returns:
a new BoundingBox object.

Property Details [hide private]

bottom

Y coordinate of the bottom of the box

Get Method:
_get_bottom(self)

coords

Sets or returns the coordinates of the corners

Get Method:
_get_coords(self) - Returns the coordinates of the corners.
Set Method:
_set_coords(self, coords) - Sets the coordinates of the corners.

height

Gets the height of the bounding box

Get Method:
_get_height(self)

left

X coordinate of the left side of the box

Get Method:
_get_left(self)

right

X coordinate of the right side of the box

Get Method:
_get_right(self)

shape

Gets the shape of the bounding box (width, height)

Get Method:
_get_shape(self)

top

Y coordinate of the top of the box

Get Method:
_get_top(self)

width

Gets the width of the bounding box

Get Method:
_get_width(self)