Template Class base_grid3D
Defined in File base_grid3D.hpp
Inheritance Relationships
Derived Types
public rcppsw::ds::grid3D< ral::mt_size_t >
(Template Class grid3D)public rcppsw::ds::grid3D< T >
(Template Class grid3D)public rcppsw::ds::grid3D_overlay< T >
(Template Class grid3D_overlay)
Class Documentation
-
template<typename T>
class base_grid3D Base class containing functionality common to all types of 3D grids.
Subclassed by rcppsw::ds::grid3D< ral::mt_size_t >, rcppsw::ds::grid3D< T >, rcppsw::ds::grid3D_overlay< T >
Public Types
-
using coord_type = rmath::vector3z
Public Functions
-
base_grid3D(void) = default
-
virtual ~base_grid3D(void) = default
-
inline T &access(const coord_type &c)
-
inline const T &access(const coord_type &c) const
-
virtual T &access(size_t i, size_t j, size_t k) = 0
Return a reference to the element at position (i, j) in the grid.
This is provided in the base class so that the pointer/object variants of the grid (grid3D, etc.) can reduce code duplication.
-
inline bool contains(const coord_type &pt)
-
inline bool contains(size_t i, size_t j, size_t k)
-
inline grid_view layer(size_t z)
Get a view of a single layer within the grid.
- Parameters:
z – 0-based index of layer within the grid.
- Returns:
The layer.
-
inline const_grid_view layer(size_t z) const
-
inline T &operator[](const coord_type &c)
-
inline const T &operator[](const coord_type &c) const
-
inline grid_view subcircle(const coord_type &c, size_t radius)
Get a 2D subcircle gridview from a 3D grid (i.e. always has height 1 in Z). The subcircle extent is cropped to the maximum boundaries of the parent grid.
This means that rather than getting a 2 x 2 subgrid centered at 0 with the out-of-bounds elements zeroed if you request a subcircle on the boundary of the overall grid, you will get a 1 x 2 subgrid (a lopsided circle).
- Parameters:
c – The X,Y,Z coordinates of the center of the subcircle.
radius – Radius of subcircle.
- Returns:
The subcircle.
-
inline const_grid_view subcircle(const coord_type &c, size_t radius) const
-
inline grid_view subgrid(const coord_type &ll, const coord_type &ur)
Create a subgrid from a grid. The specified coordinates are inclusive.
- Parameters:
ll – Lower left of the subgrid, inclusive.
ur – Upper right of the subgrid, inclusive.
- Returns:
The subgrid (closed interval).
-
inline const_grid_view subgrid(const coord_type &ll, const coord_type &ur) const
-
virtual size_t xsize(void) const = 0
Get the size of the X dimension of the grid (i.e. what is the array index in X?)
-
virtual size_t ysize(void) const = 0
Get the size of the Y dimension of the grid (i.e. what is the array index in Y?)
-
virtual size_t zsize(void) const = 0
Get the size of the Z dimension of the grid (i.e. what is the array index in Z?)
-
using coord_type = rmath::vector3z