Public Member Functions | |
def | __init__ |
def | __str__ |
def | __iter__ |
def | cell_iter |
Returns an iterator that iterates over all cells in the grid. | |
def | index_iter |
Returns an iterator that iterates over the indeces of this grid as tuples. | |
def | window_iter |
Returns an iterator that iterates over a subgrid of this grid. | |
def | wrapped_window_iter |
Returns an iterator that iterates over a subgrid of this grid. | |
def | square_iter |
Returns an iterator that iterates over all cells in the square surrounding the given point. | |
def | wrapped_square_iter |
Returns an iterator that iterates over all cells in the square surrounding the given point, wrapping around as necessary. | |
Public Attributes | |
width | |
height | |
depth |
Definition at line 652 of file enhanced_grid.py.
def enhanced_grid.Container3D.__init__ | ( | self, | ||
width, | ||||
height, | ||||
depth | ||||
) |
Definition at line 653 of file enhanced_grid.py.
def enhanced_grid.Container3D.__iter__ | ( | self | ) |
Definition at line 678 of file enhanced_grid.py.
def enhanced_grid.Container3D.__str__ | ( | self | ) |
Definition at line 661 of file enhanced_grid.py.
def enhanced_grid.Container3D.cell_iter | ( | self | ) |
Returns an iterator that iterates over all cells in the grid.
Definition at line 684 of file enhanced_grid.py.
def enhanced_grid.Container3D.index_iter | ( | self | ) |
Returns an iterator that iterates over the indeces of this grid as tuples.
If grid is a 2 by 2 grid, then:
for p in index_iter(grid): print p
0, 0 0, 1 1, 0 1, 1
for p in index_iter(grid): grid[p] = random()
Definition at line 711 of file enhanced_grid.py.
def enhanced_grid.Container3D.square_iter | ( | self, | ||
p, | ||||
n | ||||
) |
Returns an iterator that iterates over all cells in the square surrounding the given point.
The cube is 2*n + 1 units.
Definition at line 762 of file enhanced_grid.py.
def enhanced_grid.Container3D.window_iter | ( | self, | ||
p0, | ||||
p1 | ||||
) |
Returns an iterator that iterates over a subgrid of this grid.
The iterator will iterate over all cells x, y, z in the grid such that
x0 <= x < x1 y0 <= y < y1 z0 <= z < z1
Definition at line 728 of file enhanced_grid.py.
def enhanced_grid.Container3D.wrapped_square_iter | ( | self, | ||
p, | ||||
n | ||||
) |
Returns an iterator that iterates over all cells in the square surrounding the given point, wrapping around as necessary.
The cube is 2*n + 1 units.
Definition at line 771 of file enhanced_grid.py.
def enhanced_grid.Container3D.wrapped_window_iter | ( | self, | ||
p0, | ||||
p1 | ||||
) |
Returns an iterator that iterates over a subgrid of this grid.
The iterator will iterate over all cells x, y, z in the grid such that
x0 <= x < x1 y0 <= y < y1 z0 <= z < z1
Definition at line 749 of file enhanced_grid.py.
Definition at line 657 of file enhanced_grid.py.
Definition at line 656 of file enhanced_grid.py.
Definition at line 655 of file enhanced_grid.py.