#include <grid.hpp>
Public Member Functions | |
Grid () | |
Constructor. | |
Grid (matrix newList) | |
Constructor. | |
Grid (int w, int h) | |
Constructor. | |
virtual | ~Grid () |
Destructor. | |
int | getWidth () const |
Member accessor. | |
int | getHeight () const |
Member accessor. | |
matrix | getCells () const |
Member accessor. | |
void | init (const Grid &grid) |
Initializes the grid. | |
bool | operator== (Grid grid) |
Equality operator. | |
int & | operator() (int x, int y) |
Cell accessor. | |
bool | isEnabled (int x, int y) |
Cell status. | |
bool | isDisabled (int x, int y) |
Cell status. | |
bool | isInput (int x, int y) |
Cell status. | |
bool | isOutput (int x, int y) |
Cell status. | |
bool | isSpace (int x, int y) |
Cell status. | |
Private Attributes | |
matrix | cells |
Matrix of cells. | |
int | width |
Grid width. | |
int | height |
Grid height. |
The Grid class is the main class for spaces, forbidden patterns and rules, as all of them are a composition of one of two grids.
Definition at line 53 of file grid.hpp.
|
Constructor. Creates a default grid with width and height of zero. |
|
Constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Member accessor.
Definition at line 177 of file grid.cpp. References cells. Referenced by ForbiddenPattern::equals(), Rule::getFinalMatrix(), Rule::getInitialMatrix(), LayoutConfig::getMatrix(), ForbiddenPattern::getMatrix(), and init(). |
|
Member accessor.
Definition at line 92 of file grid.cpp. References height. Referenced by SimulationManager::addPattern(), SimulationManager::addRule(), LayoutCanvas::drawCells(), Simulation::findPattern(), Simulation::findRule(), init(), LayoutCanvas::initTransitions(), LayoutCanvas::resetTransitions(), RuleDiskManager::saveGrid(), LayoutDiskManager::saveGrid(), ForbiddenPatternDiskManager::saveGrid(), LayoutCanvas::setGrid(), and ForbiddenPattern::setGrid(). |
|
Member accessor.
Definition at line 102 of file grid.cpp. References width. Referenced by SimulationManager::addPattern(), SimulationManager::addRule(), LayoutCanvas::drawCells(), Simulation::findPattern(), Simulation::findRule(), init(), LayoutCanvas::initTransitions(), operator==(), Simulation::patternApplicable(), Simulation::printLayout(), SimulationManager::printPattern(), SimulationManager::rotateGrid(), Simulation::ruleApplicable(), RuleDiskManager::saveGrid(), LayoutDiskManager::saveGrid(), ForbiddenPatternDiskManager::saveGrid(), LayoutCanvas::setGrid(), and ForbiddenPattern::setGrid(). |
|
Initializes the grid.
Definition at line 80 of file grid.cpp. References cells, getCells(), getHeight(), getWidth(), height, and width. Referenced by Rule::setFinalGrid(), LayoutCanvas::setGrid(), ForbiddenPattern::setGrid(), and Rule::setInitialGrid(). Here is the call graph for this function: ![]() |
|
Cell status. Allows to know the status of the cell at x, y.
|
|
Cell status. Allows to know the status of the cell at x, y.
|
|
Cell status. Allows to know the status of the cell at x, y.
|
|
Cell status. Allows to know the status of the cell at x, y.
|
|
Cell status. Allows to know the status of the cell at x, y.
|
|
Cell accessor. Special operator to get a reference to a cell. Using this the status of a cell can be inspected this way: int status = grid(x, y) or modified the same way: grid(x, y) = nENABLED.
Definition at line 192 of file grid.cpp. References cells. |
|
Equality operator.
Definition at line 205 of file grid.cpp. References getWidth(). Here is the call graph for this function: ![]() |
|
Matrix of cells.
Definition at line 74 of file grid.hpp. Referenced by getCells(), Grid(), init(), isDisabled(), isEnabled(), isInput(), isOutput(), isSpace(), and operator()(). |
|
Grid height.
Definition at line 78 of file grid.hpp. Referenced by getHeight(), Grid(), and init(). |
|
Grid width.
Definition at line 76 of file grid.hpp. Referenced by getWidth(), Grid(), and init(). |