cgv
Loading...
Searching...
No Matches
cgv::data::grid< Pnt, Idx > Class Template Reference
Inheritance diagram for cgv::data::grid< Pnt, Idx >:

Public Member Functions

 grid (Idx dim=20)
 
 grid (Idx dimx, Idx dimy, Idx dimz)
 
void clear ()
 
bool is_empty () const
 
void set_dim (Cnt dim)
 
void set_dim (Cnt dimx, Cnt dimy, Cnt dimz)
 
void set_box (const Pnt &_min_pnt, const Pnt &_max_pnt)
 
template<typename Func >
void compute_box (Idx nr_points, const Func &pnts)
 
template<typename Func >
void build (Idx nr_points, const Func &pnts)
 before calling the build function, ensure that the bounding box has been set with set_box or computed with compute_box
 
Idx get_size () const
 
template<typename Jdx >
Idx get_index (Jdx *ci) const
 
Idx get_index (const Pnt &p) const
 
template<typename Jdx >
void split_index (Idx idx, Jdx *ci) const
 
void put_grid_cell (Idx idx, const Pnt &_min_pnt, const Pnt &_max_pnt) const
 
void insert (const Pnt &p, Idx i)
 
void add_neighbors (Idx pi, const Pnt &p, Idx ci, const Func &pnts, vector< Idx > &N) const
 
template<typename Func >
void extract_neighbors (Idx i, const Func &pnts, vector< Idx > &N) const
 

Public Attributes

decltype(min_pnt[0]) Crd
 
decltype(max_pnt-min_pnt) Vec
 
std::size_t dim [3]
 
Crd rmax
 
Crd rmax_sqr
 
Crd rmax_estimate_factor
 

Protected Member Functions

void init ()
 
void compute_scales ()
 

Protected Attributes

Vec scale
 
Vec extent
 
Vec cell_extent
 
Pnt min_pnt
 
Pnt max_pnt
 

Detailed Description

template<typename Pnt, typename Idx = int>
class cgv::data::grid< Pnt, Idx >

Definition at line 8 of file grid.h.

Constructor & Destructor Documentation

◆ grid() [1/2]

template<typename Pnt , typename Idx = int>
cgv::data::grid< Pnt, Idx >::grid ( Idx  dim = 20)
inline

Definition at line 35 of file grid.h.

◆ grid() [2/2]

template<typename Pnt , typename Idx = int>
cgv::data::grid< Pnt, Idx >::grid ( Idx  dimx,
Idx  dimy,
Idx  dimz 
)
inline

Definition at line 36 of file grid.h.

Member Function Documentation

◆ add_neighbors()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::add_neighbors ( Idx  pi,
const Pnt &  p,
Idx  ci,
const Func &  pnts,
vector< Idx > &  N 
) const
inline

Definition at line 119 of file grid.h.

◆ build()

template<typename Pnt , typename Idx = int>
template<typename Func >
void cgv::data::grid< Pnt, Idx >::build ( Idx  nr_points,
const Func &  pnts 
)
inline

before calling the build function, ensure that the bounding box has been set with set_box or computed with compute_box

Definition at line 71 of file grid.h.

◆ clear()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::clear ( )
inline

Definition at line 37 of file grid.h.

◆ compute_box()

template<typename Pnt , typename Idx = int>
template<typename Func >
void cgv::data::grid< Pnt, Idx >::compute_box ( Idx  nr_points,
const Func &  pnts 
)
inline

Definition at line 57 of file grid.h.

◆ compute_scales()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::compute_scales ( )
inlineprotected

Definition at line 27 of file grid.h.

◆ extract_neighbors()

template<typename Pnt , typename Idx = int>
template<typename Func >
void cgv::data::grid< Pnt, Idx >::extract_neighbors ( Idx  i,
const Func &  pnts,
vector< Idx > &  N 
) const
inline

Definition at line 129 of file grid.h.

◆ get_index() [1/2]

template<typename Pnt , typename Idx = int>
Idx cgv::data::grid< Pnt, Idx >::get_index ( const Pnt &  p) const
inline

Definition at line 87 of file grid.h.

◆ get_index() [2/2]

template<typename Pnt , typename Idx = int>
template<typename Jdx >
Idx cgv::data::grid< Pnt, Idx >::get_index ( Jdx *  ci) const
inline

Definition at line 84 of file grid.h.

◆ get_size()

template<typename Pnt , typename Idx = int>
Idx cgv::data::grid< Pnt, Idx >::get_size ( ) const
inline

Definition at line 80 of file grid.h.

◆ init()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::init ( )
inlineprotected

Definition at line 23 of file grid.h.

◆ insert()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::insert ( const Pnt &  p,
Idx  i 
)
inline

Definition at line 111 of file grid.h.

◆ is_empty()

template<typename Pnt , typename Idx = int>
bool cgv::data::grid< Pnt, Idx >::is_empty ( ) const
inline

Definition at line 42 of file grid.h.

◆ put_grid_cell()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::put_grid_cell ( Idx  idx,
const Pnt &  _min_pnt,
const Pnt &  _max_pnt 
) const
inline

Definition at line 104 of file grid.h.

◆ set_box()

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::set_box ( const Pnt &  _min_pnt,
const Pnt &  _max_pnt 
)
inline

Definition at line 51 of file grid.h.

◆ set_dim() [1/2]

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::set_dim ( Cnt  dim)
inline

Definition at line 43 of file grid.h.

◆ set_dim() [2/2]

template<typename Pnt , typename Idx = int>
void cgv::data::grid< Pnt, Idx >::set_dim ( Cnt  dimx,
Cnt  dimy,
Cnt  dimz 
)
inline

Definition at line 44 of file grid.h.

◆ split_index()

template<typename Pnt , typename Idx = int>
template<typename Jdx >
void cgv::data::grid< Pnt, Idx >::split_index ( Idx  idx,
Jdx *  ci 
) const
inline

Definition at line 97 of file grid.h.

Member Data Documentation

◆ cell_extent

template<typename Pnt , typename Idx = int>
Vec cgv::data::grid< Pnt, Idx >::cell_extent
protected

Definition at line 20 of file grid.h.

◆ Crd

template<typename Pnt , typename Idx = int>
decltype(min_pnt[0]) cgv::data::grid< Pnt, Idx >::Crd

Definition at line 11 of file grid.h.

◆ dim

template<typename Pnt , typename Idx = int>
std::size_t cgv::data::grid< Pnt, Idx >::dim[3]

Definition at line 13 of file grid.h.

◆ extent

template<typename Pnt , typename Idx = int>
Vec cgv::data::grid< Pnt, Idx >::extent
protected

Definition at line 19 of file grid.h.

◆ max_pnt

template<typename Pnt , typename Idx = int>
Pnt cgv::data::grid< Pnt, Idx >::max_pnt
protected

Definition at line 21 of file grid.h.

◆ min_pnt

template<typename Pnt , typename Idx = int>
Pnt cgv::data::grid< Pnt, Idx >::min_pnt
protected

Definition at line 21 of file grid.h.

◆ rmax

template<typename Pnt , typename Idx = int>
Crd cgv::data::grid< Pnt, Idx >::rmax

Definition at line 14 of file grid.h.

◆ rmax_estimate_factor

template<typename Pnt , typename Idx = int>
Crd cgv::data::grid< Pnt, Idx >::rmax_estimate_factor

Definition at line 16 of file grid.h.

◆ rmax_sqr

template<typename Pnt , typename Idx = int>
Crd cgv::data::grid< Pnt, Idx >::rmax_sqr

Definition at line 15 of file grid.h.

◆ scale

template<typename Pnt , typename Idx = int>
Vec cgv::data::grid< Pnt, Idx >::scale
protected

Definition at line 18 of file grid.h.

◆ Vec

template<typename Pnt , typename Idx = int>
decltype(max_pnt-min_pnt) cgv::data::grid< Pnt, Idx >::Vec

Definition at line 12 of file grid.h.


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