PointSampler library (C++)
Loading...
Searching...
No Matches
ps::GridND< T, N > Struct Template Reference

#include <poisson_disk_sampling.hpp>

Public Member Functions

 GridND (const std::array< size_t, N > &size, T cell_size_)
 
std::array< size_t, Npoint_to_grid (const Point< T, N > &p, const std::array< std::pair< T, T >, N > &ranges) const
 
size_t linear_index (const std::array< size_t, N > &idx) const
 
std::optional< Point< T, N > > operator[] (const std::array< size_t, N > &idx) const
 
std::optional< Point< T, N > > & operator[] (const std::array< size_t, N > &idx)
 

Public Attributes

std::vector< std::optional< Point< T, N > > > cells
 
std::array< size_t, Ngrid_size {}
 
T cell_size
 

Constructor & Destructor Documentation

◆ GridND()

template<typename T , size_t N>
ps::GridND< T, N >::GridND ( const std::array< size_t, N > &  size,
T  cell_size_ 
)
inline

Member Function Documentation

◆ linear_index()

template<typename T , size_t N>
size_t ps::GridND< T, N >::linear_index ( const std::array< size_t, N > &  idx) const
inline

◆ operator[]() [1/2]

template<typename T , size_t N>
std::optional< Point< T, N > > & ps::GridND< T, N >::operator[] ( const std::array< size_t, N > &  idx)
inline

◆ operator[]() [2/2]

template<typename T , size_t N>
std::optional< Point< T, N > > ps::GridND< T, N >::operator[] ( const std::array< size_t, N > &  idx) const
inline

◆ point_to_grid()

template<typename T , size_t N>
std::array< size_t, N > ps::GridND< T, N >::point_to_grid ( const Point< T, N > &  p,
const std::array< std::pair< T, T >, N > &  ranges 
) const
inline

Member Data Documentation

◆ cell_size

template<typename T , size_t N>
T ps::GridND< T, N >::cell_size

◆ cells

template<typename T , size_t N>
std::vector<std::optional<Point<T, N> > > ps::GridND< T, N >::cells

◆ grid_size

template<typename T , size_t N>
std::array<size_t, N> ps::GridND< T, N >::grid_size {}

The documentation for this struct was generated from the following file: