|
__init__(self,
xMin,
xMax,
yMin,
yMax,
gridSquareSize,
windowWidth=400)
Basic initializer that determines the number of cells, and calls the
makeStartingGrid method that any subclass must provide,
to get the initial values. |
|
|
|
makeWindow(self,
windowWidth=400,
title=' Grid Map ' )
Create a window of the right dimensions representing the grid map. |
|
|
|
xToIndex(self,
x)
Returns:
x grid index it maps into |
|
|
|
yToIndex(self,
y)
Returns:
y grid index it maps into |
|
|
|
indexToX(self,
ix)
Returns:
the real x coordinate of the center of that grid cell |
|
|
|
indexToY(self,
iy)
Returns:
the real y coordinate of the center of that grid cell |
|
|
|
pointToIndices(self,
point)
Returns:
pair of (x, y) grid indices it maps into |
|
|
|
indicesToPoint(self,
(ix, iy))
Returns:
c{Point} in real world coordinates of center of cell |
|
|
|
boxDim(self)
Returns:
size of a grid cell in the drawing window in pixels |
|
|
|
drawWorld(self)
Clears the whole window and redraws the grid |
|
|
|
|
|
drawSquare(self,
indices,
color=None)
Recolors the existing square |
|
|
|
drawPath(self,
path)
Draws list of cells; first one is purple, last is yellow, rest are
blue |
|
|
|
undrawPath(self,
path)
Draws list of cells using the underlying grid color scheme,
effectively 'undrawing' a path. |
|
|
|
squareColor(self,
indices)
Default color scheme: squares that the robot can occupy are white
and others are black. |
|
|
|
xMin
X coordinate of left edge
|
|
xMax
X coordinate of right edge
|
|
yMin
Y coordinate of bottom edge
|
|
yMax
Y coordinate of top edge
|
|
xN
number of cells in x dimension
|
|
yN
number of cells in y dimension
|
|
xStep
size of a side of a cell in the x dimension
|
|
yStep
size of a side of a cell in the y dimension
|
|
grid
values stored in the grid cells
|
|
graphicsGrid
graphics objects
|