Template Class stacked_grid2D
Defined in File stacked_grid2D.hpp
Class Documentation
-
template<typename TupleTypes>
class stacked_grid2D A sandwich of N 2D grids of the same size (x,y) dimensions, which can contain different kinds of objects. The objects in each layer of the grid are stored contiguously, but the grids themselves are not necessarily contiguous. The layers are 0 indexed.
This was implemented because the BGL only appears to support layered graphs/grids of the same object type. Although in hindsight I could have done this with grid_graph and std::variant (was not aware of this when I implemented this class). Might not have been as highly performing in that case though.
Public Types
-
template<size_t Index>
using layer_value_type = rcppsw::ds::grid2D_overlay<value_type<Index>> The type of a particular layer.
- Template Parameters:
Index – The index of the layer.
-
template<size_t Index>
using value_type = typename std::tuple_element<Index, TupleTypes>::type The type of the objects stored in a particular layer.
- Template Parameters:
Index – The index of the layer.
Public Functions
-
inline stacked_grid2D(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 stacked 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 ~stacked_grid2D(void)
-
template<size_t Index>
inline layer_value_type<Index>::value_type &access(const math::vector2z &d) Get a reference to an object at a particular (layer,i,j) location.
- Template Parameters:
Index – The index of the layer.
- Parameters:
d – The discrete coordinate pair.
-
template<size_t Index>
inline const layer_value_type<Index>::value_type &access(const math::vector2z &d) const
-
template<size_t Index>
inline layer_value_type<Index>::value_type &access(size_t i, size_t j) Get a reference to an object at a particular (layer,i,j) location.
- Template Parameters:
Index – The index of the layer.
- Parameters:
i – The x coordinate.
j – The y coordinate.
-
template<size_t Index>
inline const layer_value_type<Index>::value_type &access(size_t i, size_t j) const
-
inline rmath::vector2z ddims2D(void) const
-
template<size_t Index>
inline layer_value_type<Index> *layer(void)
-
template<size_t Index>
inline const layer_value_type<Index> *layer(void) const
-
inline rmath::vector2d rdims2D(void) const
-
inline const types::discretize_ratio &resolution(void) const
See also
-
inline size_t xdsize(void) const
See also
-
inline double xrsize(void) const
See also
-
inline size_t ydsize(void) const
See also
-
inline double yrsize(void) const
See also
-
template<size_t Index>