Template Struct index3d_t

Struct Documentation

template<typename cell_coord_t = int32_t>
struct index3d_t

Discrete 3D voxel index: a plain (cx, cy, cz) triple of integer coordinates.

Suitable for both std::map (using index3d_hash as comparator) and std::unordered_map / tsl::robin_map (using index3d_hash as hash).

The default coordinate type is int32_t, which covers roughly ±2×10⁹ voxels per axis. Use uint32_t for inner (non-negative) indices in dense grids.

See also

index3d_hash for the associated hash / comparator functor.

Public Functions

index3d_t() = default
inline index3d_t(cell_coord_t Cx, cell_coord_t Cy, cell_coord_t Cz) noexcept
inline bool operator==(const index3d_t<cell_coord_t> &o) const noexcept
inline bool operator!=(const index3d_t<cell_coord_t> &o) const noexcept
inline index3d_t operator+(const index3d_t &o) const noexcept
inline index3d_t operator-(const index3d_t &o) const noexcept

Public Members

cell_coord_t cx = 0
cell_coord_t cy = 0
cell_coord_t cz = 0