Dense grids support random, indexed access to each cell. These grids have a finite extent and thus can hold cell data in finite memory. Dense grids are regular grids, meaning they satisfy Beluga named requirements: RegularGrid requirements.
A type G
satisfies DenseGrid2
requirements if it satisfies Beluga named requirements: RegularGrid and given g
a possibly const instance of G
:
g.width()
returns the grid width, in grid cells along the grid x-axis, as an std::size_t
value.g.height()
returns the grid height, in grid cells along the grid y-axis, as an std::size_t
value.xi
and yi
of type int
, g.contains(xi, yi)
checks whether such cell is included in the grid;pi
of Eigen::Vector2i
type, g.contains(p)
checks whether such cell is included in the grid;xi
and yi
of type int
, g.index_at(xi, yi)
retrieves the corresponding cell index of some type;pi
of Eigen::Vector2i
type, g.index_at(pi)
retrieves the corresponding cell index of some type;xi
and yi
of type int
, g.data_at(xi, yi)
optionally returns cell data, if cell is included;pi
of Eigen::Vector2i
type, g.data_at(p)
optionally returns cell data, if cell is included;i
of some type, g.data_at(i)
optionally returns cell data, if cell is included;x
and y
of type double
, g.data_near(x, y)
optionally returns cell data, if cell is included;p
of Eigen::Vector2d
type, g.data_near(p)
optionally returns cell data, if cell is included;xi
and yi
of type int
, g.neighborhood4(xi, yi)
computes the cell 4-connected neighborhood as a range of Eigen::Vector2i
type;pi
of Eigen::Vector2i
type, g.neighborhood4(p)
computes the cell 4-connected neighborhood as a range of Eigen::Vector2i
type.