iMSTK
Interactive Medical Simulation Toolkit
|
A wrapper class for Grid-based and spatial-hashing neighbor search. More...
#include <imstkNeighborSearch.h>
Public Types | |
enum | Method { UniformGridBasedSearch, SpatialHashing } |
Public Member Functions | |
NeighborSearch (Method searchMethod, double searchRadius=0.0) | |
Constructor. More... | |
void | setSearchRadius (const double searchRadius) |
Set the search radius. | |
double | getSearchRadius () const |
Get the current search radius. | |
std::vector< std::vector< size_t > > | getNeighbors (const VecDataArray< double, 3 > &points) |
Search neighbors for each points within the search radius. More... | |
void | getNeighbors (std::vector< std::vector< size_t >> &result, const VecDataArray< double, 3 > &points) |
Search neighbors for each point within the search radius. More... | |
void | getNeighbors (std::vector< std::vector< size_t >> &result, const VecDataArray< double, 3 > &setA, const VecDataArray< double, 3 > &setB) |
Search neighbors from setB for each point in setA within the search radius. SetA and setB can be different. More... | |
A wrapper class for Grid-based and spatial-hashing neighbor search.
Definition at line 21 of file imstkNeighborSearch.h.
imstk::NeighborSearch::NeighborSearch | ( | NeighborSearch::Method | searchMethod, |
double | searchRadius = 0.0 |
||
) |
Constructor.
The | selected search method |
Definition at line 14 of file imstkNeighborSearch.cpp.
std::vector< std::vector< size_t > > imstk::NeighborSearch::getNeighbors | ( | const VecDataArray< double, 3 > & | points | ) |
Search neighbors for each points within the search radius.
points | The given points to search for neighbors |
Definition at line 44 of file imstkNeighborSearch.cpp.
void imstk::NeighborSearch::getNeighbors | ( | std::vector< std::vector< size_t >> & | result, |
const VecDataArray< double, 3 > & | points | ||
) |
Search neighbors for each point within the search radius.
result | The list of lists of neighbor indices for each point |
points | The given points to search for neighbors |
Definition at line 52 of file imstkNeighborSearch.cpp.
void imstk::NeighborSearch::getNeighbors | ( | std::vector< std::vector< size_t >> & | result, |
const VecDataArray< double, 3 > & | setA, | ||
const VecDataArray< double, 3 > & | setB | ||
) |
Search neighbors from setB for each point in setA within the search radius. SetA and setB can be different.
result | The list of lists of neighbors for each point |
setA | The point set for which performing neighbor search |
setB | The point set where neighbor indices will be collected |
Definition at line 58 of file imstkNeighborSearch.cpp.