#include <grid.hpp>
Collaboration diagram for Arak::Grid< ItemType >::Cell:
The window is partitioned into a grid of cells. Each cell includes its bottom and left boundaries, and cells against the top and/or right boundaries of the region also include these edges. In this way each point in the region is assigned to exactly one grid cell.
Definition at line 30 of file grid.hpp.
Public Types | |
typedef std::list< ItemType > | ItemList |
A list of the items associated with this cell. | |
Public Member Functions | |
Cell (const Geometry::Rectangle &r, int row, int col) | |
Constructor. | |
Entry | add (const ItemType &e) |
Adds an item to this cell's list of items. | |
const ItemList & | getItemList () const |
Returns a const reference to this cell's list of items. | |
ItemList & | getItemList () |
Returns a mutable reference to this cell's list of items. | |
int | row () const |
Returns the row index of this cell. | |
int | col () const |
Returns the column index of this cell. | |
bool | operator== (const Cell &other) const |
Equality operations. | |
bool | operator!= (const Cell &other) const |
Geometry::Point | center () const |
Returns the point at the center of this cell. | |
Protected Types | |
typedef ItemList::iterator | ItemIterator |
An iterator for an interior edge list. | |
Protected Attributes | |
int | r |
The row index of this cell. | |
int | c |
The column index of this cell. | |
ItemList | items |
A list of items associated with this cell. | |
ItemList | unused |
A list of unused items. | |
Cell * | up |
A pointer to the cell that is immediately above this cell. | |
Cell * | down |
A pointer to the cell that is immediately below this cell. | |
Cell * | right |
A pointer to the cell that is immediately to the right of this cell. | |
Cell * | left |
A pointer to the cell that is immediately to the left of this cell. | |
Friends | |
class | Grid |
class | Grid::LineCellIterator |
class | Grid::ConstLineCellIterator |
class | Grid::RectangleCellIterator |
class | Grid::ConstRectangleCellIterator |
class | Grid::TriangleCellIterator |
class | Grid::ConstTriangleCellIterator |
class | Grid::ConvexPolygonCellIterator |
class | Grid::ConstConvexPolygonCellIterator |
|
An iterator for an interior edge list.
Definition at line 54 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::add(), and Arak::Grid< ItemType >::Cell::Entry::Entry(). |
|
A list of the items associated with this cell.
Definition at line 47 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::getItemList(). |
|
Constructor.
Definition at line 164 of file grid.hpp. References Arak::Grid< ItemType >::Cell::down, Arak::Grid< ItemType >::Cell::items, Arak::Grid< ItemType >::Cell::left, Arak::Geometry::Rectangle, and Arak::Grid< ItemType >::Cell::right. |
|
Adds an item to this cell's list of items. The entry in which the item is stored is returned.
Definition at line 175 of file grid.hpp. References Arak::Grid< ItemType >::Cell::ItemIterator, and Arak::Grid< ItemType >::Cell::items. |
|
Returns the point at the center of this cell.
Definition at line 221 of file grid.hpp. References Arak::Geometry::Point. |
|
Returns the column index of this cell.
Definition at line 210 of file grid.hpp. Referenced by Arak::Grid< ItemType >::ConvexPolygonCellIteratorBase< GridType, CellType >::ConvexPolygonCellIteratorBase(), and Arak::Grid< ItemType >::TriangleCellIteratorBase< GridType, CellType >::TriangleCellIteratorBase(). |
|
Returns a mutable reference to this cell's list of items.
Definition at line 198 of file grid.hpp. References Arak::Grid< ItemType >::Cell::ItemList, and Arak::Grid< ItemType >::Cell::items. |
|
Returns a const reference to this cell's list of items.
Definition at line 191 of file grid.hpp. References Arak::Grid< ItemType >::Cell::ItemList, and Arak::Grid< ItemType >::Cell::items. |
|
|
|
Equality operations.
|
|
Returns the row index of this cell.
Definition at line 205 of file grid.hpp. References Arak::Grid< ItemType >::Cell::r. Referenced by Arak::Grid< ItemType >::ConvexPolygonCellIteratorBase< GridType, CellType >::ConvexPolygonCellIteratorBase(), and Arak::Grid< ItemType >::TriangleCellIteratorBase< GridType, CellType >::TriangleCellIteratorBase(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The column index of this cell.
|
|
A pointer to the cell that is immediately below this cell. If there is no such cell, this is NULL. Definition at line 87 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::Cell(). |
|
A list of items associated with this cell.
Definition at line 69 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::add(), Arak::Grid< ItemType >::Cell::Cell(), Arak::Grid< ItemType >::Cell::getItemList(), and Arak::Grid< ItemType >::Cell::Entry::remove(). |
|
A pointer to the cell that is immediately to the left of this cell. If there is no such cell, this is NULL. Definition at line 99 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::Cell(). |
|
The row index of this cell.
Definition at line 59 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::row(). |
|
A pointer to the cell that is immediately to the right of this cell. If there is no such cell, this is NULL. Definition at line 93 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::Cell(). |
|
A list of unused items. This list is used to avoid memory allocation overhead associated with adding items to items. Definition at line 75 of file grid.hpp. Referenced by Arak::Grid< ItemType >::Cell::Entry::remove(). |
|
A pointer to the cell that is immediately above this cell. If there is no such cell, this is NULL. |