#include <grid.hpp>
Each cell is associated with a list of items that can be updated. This class supports linear-time access to all cells that intersect a given line segment, ray, rectangle, or triangle.
Definition at line 18 of file grid.hpp.
Public Types | |
typedef LineCellIteratorBase< Grid, Cell > | LineCellIterator |
A mutable forwards iterator that ranges over the cells whose closures intersect a given ray or line segment. | |
typedef LineCellIteratorBase< const Grid, const Cell > | ConstLineCellIterator |
A const forwards iterator that ranges over the cells whose closures intersect a given ray or line segment. | |
typedef RectangleCellIteratorBase< Grid, Cell > | RectangleCellIterator |
A mutable forwards iterator that ranges over the cells whose closures intersect a given rectangle. | |
typedef RectangleCellIteratorBase< const Grid, const Cell > | ConstRectangleCellIterator |
A const forwards iterator that ranges over the cells whose closures intersect a given rectangle. | |
typedef TriangleCellIteratorBase< Grid, Cell > | TriangleCellIterator |
A mutable forwards iterator that ranges over the cells whose closures intersect a given triangle. | |
typedef TriangleCellIteratorBase< const Grid, const Cell > | ConstTriangleCellIterator |
A const forwards iterator that ranges over the cells whose closures intersect a given triangle. | |
typedef ConvexPolygonCellIteratorBase< Grid, Cell > | ConvexPolygonCellIterator |
A mutable forwards iterator that ranges over the cells whose closures intersect a given convex polygon. | |
typedef ConvexPolygonCellIteratorBase< const Grid, const Cell > | ConstConvexPolygonCellIterator |
A const forwards iterator that ranges over the cells whose closures intersect a given convex polygon. | |
Public Member Functions | |
Grid (const Geometry::Rectangle &boundary, int rows, int cols) | |
Default constructor. | |
~Grid () | |
Destructor. | |
int | numRows () const |
Returns the number of rows in the grid. | |
int | numCols () const |
Returns the number of columns in the grid. | |
const Geometry::Rectangle & | boundary () const |
Returns a const reference to the boundary of the indexed region. | |
bool | getCellCoords (const Geometry::Point &p, int &i, int &j) const |
Updates the supplied parameters to the row and column index of the cell that contains the supplied point. | |
const Cell & | getCell (const int i, const int j) const |
Returns a const reference to the cell with the supplied row and column index. | |
Cell & | getCell (const int i, const int j) |
Returns a mutable reference to the cell with the supplied row and column index. | |
const Cell & | getCell (const Geometry::Point &p) const |
Returns a const reference to the cell that contains the supplied point. | |
Cell & | getCell (const Geometry::Point &p) |
Returns a reference to the cell that contains the supplied point. | |
Protected Attributes | |
const Geometry::Rectangle | bd |
The boundary of the grid. | |
std::vector< std::vector< Cell * > > | cells |
A two-dimensional vector of cells. | |
const int | rows |
The number of rows in the grid. | |
const int | cols |
The number of columns in the grid. | |
Geometry::Kernel::FT | cellWidth |
The (approximate) width of the grid cells. | |
Geometry::Kernel::FT | cellHeight |
The (approximate) height of the grid cells. | |
std::vector< Geometry::Kernel::FT > | xvals |
A vector containing the x values of the (cols + 1) vertical grid lines. | |
std::vector< Geometry::Kernel::FT > | yvals |
A vector containing the y values of the (rows + 1) horizontal grid lines. |
|
A const forwards iterator that ranges over the cells whose closures intersect a given convex polygon.
|
|
A const forwards iterator that ranges over the cells whose closures intersect a given ray or line segment.
Definition at line 519 of file grid.hpp. Referenced by Arak::Grid< ItemType >::ConvexPolygonCellIteratorBase< GridType, CellType >::ConvexPolygonCellIteratorBase(), and Arak::Grid< ItemType >::TriangleCellIteratorBase< GridType, CellType >::TriangleCellIteratorBase(). |
|
A const forwards iterator that ranges over the cells whose closures intersect a given rectangle.
|
|
A const forwards iterator that ranges over the cells whose closures intersect a given triangle.
|
|
A mutable forwards iterator that ranges over the cells whose closures intersect a given convex polygon.
Definition at line 963 of file grid.hpp. Referenced by Arak::Grid< ItemType >::ConvexPolygonCellIteratorBase< GridType, CellType >::operator++(). |
|
A mutable forwards iterator that ranges over the cells whose closures intersect a given ray or line segment.
|
|
A mutable forwards iterator that ranges over the cells whose closures intersect a given rectangle.
|
|
A mutable forwards iterator that ranges over the cells whose closures intersect a given triangle.
Definition at line 797 of file grid.hpp. Referenced by Arak::Grid< ItemType >::TriangleCellIteratorBase< GridType, CellType >::operator++(). |
|
Default constructor.
|
|
Destructor.
|
|
Returns a const reference to the boundary of the indexed region.
Definition at line 1108 of file grid.hpp. Referenced by Arak::ArakPosteriorSonarObs::boundary(), Arak::ArakPosteriorRangeObs::boundary(), Arak::ArakPosteriorRangeObs::retraceObs(), and Arak::GridColorEstimator::write(). |
|
Returns a reference to the cell that contains the supplied point.
|
|
Returns a const reference to the cell that contains the supplied point.
|
|
Returns a mutable reference to the cell with the supplied row and column index.
|
|
Returns a const reference to the cell with the supplied row and column index.
Definition at line 1149 of file grid.hpp. Referenced by Arak::Grid< PointColorEstimator * >::getCell(), Arak::GridColorEstimator::GridColorEstimator(), Arak::GridColorEstimator::visualize(), and Arak::GridColorEstimator::write(). |
|
Updates the supplied parameters to the row and column index of the cell that contains the supplied point.
Definition at line 1119 of file grid.hpp. Referenced by Arak::Grid< PointColorEstimator * >::getCell(). |
|
Returns the number of columns in the grid.
Definition at line 1099 of file grid.hpp. Referenced by Arak::Coloring::read(), Arak::Coloring::readBinary(), Arak::GridColorEstimator::visualize(), and Arak::GridColorEstimator::write(). |
|
Returns the number of rows in the grid.
Definition at line 1092 of file grid.hpp. Referenced by Arak::Coloring::read(), Arak::Coloring::readBinary(), Arak::GridColorEstimator::visualize(), and Arak::GridColorEstimator::write(). |
|
The boundary of the grid.
|
|
The (approximate) height of the grid cells.
|
|
A two-dimensional vector of cells.
|
|
The (approximate) width of the grid cells.
|
|
The number of columns in the grid.
|
|
The number of rows in the grid.
|
|
A vector containing the x values of the (cols + 1) vertical grid lines.
The first of these is the left boundary of the grid, and the last is the right boundary of the grid. Each grid cell in column j spans the interval |
|
A vector containing the y values of the (rows + 1) horizontal grid lines.
The first of these is the bottom boundary of the grid, and the last is the top boundary of the grid. Each grid cell in row i spans the interval |