iMSTK
Interactive Medical Simulation Toolkit
Public Types | Public Member Functions | List of all members
imstk::NeighborSearch Class Reference

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...
 

Detailed Description

A wrapper class for Grid-based and spatial-hashing neighbor search.

Definition at line 21 of file imstkNeighborSearch.h.

Constructor & Destructor Documentation

◆ NeighborSearch()

imstk::NeighborSearch::NeighborSearch ( NeighborSearch::Method  searchMethod,
double  searchRadius = 0.0 
)

Constructor.

Parameters
Theselected search method

Definition at line 14 of file imstkNeighborSearch.cpp.

Member Function Documentation

◆ getNeighbors() [1/3]

std::vector< std::vector< size_t > > imstk::NeighborSearch::getNeighbors ( const VecDataArray< double, 3 > &  points)

Search neighbors for each points within the search radius.

Parameters
pointsThe given points to search for neighbors
Returns
List of list of neighbor indices for each point

Definition at line 44 of file imstkNeighborSearch.cpp.

Here is the caller graph for this function:

◆ getNeighbors() [2/3]

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.

Parameters
resultThe list of lists of neighbor indices for each point
pointsThe given points to search for neighbors

Definition at line 52 of file imstkNeighborSearch.cpp.

Here is the call graph for this function:

◆ getNeighbors() [3/3]

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.

Parameters
resultThe list of lists of neighbors for each point
setAThe point set for which performing neighbor search
setBThe point set where neighbor indices will be collected

Definition at line 58 of file imstkNeighborSearch.cpp.


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