Template Class grid2D_overlay

Inheritance Relationships

Base Types

Class Documentation

template<typename T>
class grid2D_overlay : public rcppsw::ds::base_grid2D<T>, public rcppsw::ds::base_grid_overlay<math::vector2d>, public rcppsw::er::client<grid2D_overlay<T>>

A 2D logical grid overlayed over a continuous environment using a contiguous array of the template parameter type (.

See also

base_grid_overlay).

Template Parameters:

T – The type of the grid element (probably a cell of some kind). Must have must have a zero parameter constructor available or it won’t compile (this is a limitation of boost::multi_array). Furthermore, T must also have a copy constructor available, as move semantics are not supported by boost::multi_array.

Public Functions

inline grid2D_overlay(const math::vector2d &origin, const math::vector2d &dims, const types::discretize_ratio &grid_res, const types::discretize_ratio &field_res)
Parameters:
  • origin – The anchor point of the overlay grid in continuous space.

  • dims – The real size in X,Y which will be discretized into X/grid_res discrete elements along the X dimension and Y/grid_res discrete elements along the Y dimension.

  • grid_res – The discretization unit for the grid.

  • field_res – The discretization unit for the field the grid is contained in (can be the same as the grid_res).

inline virtual T &access(size_t i, size_t j) override

Get a reference to a the cell within the grid at coordinates (i, j)

Returns:

Reference to the cell, of type T.

inline coord_type ddims2D(void) const

Get the discrete dimensions of the grid.

inline const math::vector2d &rdims2D(void) const

Get the real dimensions of the grid; that is, continuous floating point.

inline size_t xdsize(void) const

Get the discrete size of the X dimension of the grid (i.e. what is the array index in X?)

inline double xrsize(void) const

Get the size of the X dimension (non-discretized).

inline size_t ydsize(void) const

Get the discrete size of the Y dimension of the grid (i.e. what is the array index in Y?)

inline double yrsize(void) const

Get the size of the Y dimension (non-discretized).