Package lib :: Module geom :: Class GLayout
[hide private]
[frames] | no frames]

Class GLayout

source code

object --+
         |
        GLayout

grid layout manager

Instance Methods [hide private]
 
__init__(self, rect, nrows=1, ncols=1, pad=(0.0, 0.0, 0.0, 0.0))
initialize layout
source code
int
row_count(self)
get (max) number of rows in the grid
source code
int
col_count(self)
get (max) number of columns in the grid
source code
int
count(self)
get total number of cells in the grid (which is rows*cols)
source code
 
resize(self, rows, cols)
resize grid by specifying new number of rows and columns
source code
(float,float,float,float)
item(self, row, col)
get rect of cell at position row,col
source code
(float,float,float,float)
item_seq(self, k, column_wise=False)
get rect of cell at position k column-wise or row-wise
source code
(float,float,float,float),...
items(self, column_wise=False)
get sequence of rects of cells column-wise or row-wise
source code
(float,float,float,float),...
row_items(self, row)
get sequence of cell rects of a row
source code
(float,float,float,float),...
col_items(self, col)
get sequence of cell rects of a column
source code
(float,float,float,float)
item_span(self, nr, nc, row=-1, col=-1)
get union of cell rects spanning a subgrid
source code

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

Instance Variables [hide private]
  hrep
internal HLayout for column computations
  vrep
internal VLayout for row computations
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, rect, nrows=1, ncols=1, pad=(0.0, 0.0, 0.0, 0.0))
(Constructor)

source code 

initialize layout

Parameters:
  • rect - layout rect (tuple)
  • nrows - number of rows
  • ncols - number of columns
  • pad - cell padding
Overrides: object.__init__

item_span(self, nr, nc, row=-1, col=-1)

source code 

get union of cell rects spanning a subgrid

Parameters:
  • nr - number of spanning rows
  • nc - number of spanning columns
  • row - starting row, -1 for vertically centered
  • col - starting column, -1 for horizontally centered
Returns: (float,float,float,float)