CubbyFlow::PointNeighborSearcher< N > Class Template Referenceabstract

Abstract base class for N-D neighbor point searcher. More...

#include <Core/Searcher/PointNeighborSearcher.hpp>

Inheritance diagram for CubbyFlow::PointNeighborSearcher< N >:
CubbyFlow::Serializable CubbyFlow::PointHashGridSearcher< N > CubbyFlow::PointKdTreeSearcher< N > CubbyFlow::PointParallelHashGridSearcher< N > CubbyFlow::PointSimpleListSearcher< N >

Public Types

using ForEachNearbyPointFunc = std::function< void(size_t, const Vector< double, N > &)>
 

Public Member Functions

 PointNeighborSearcher ()=default
 Default constructor. More...
 
 ~PointNeighborSearcher () override=default
 Default virtual destructor. More...
 
 PointNeighborSearcher (const PointNeighborSearcher &other)=default
 Default copy constructor. More...
 
 PointNeighborSearcher (PointNeighborSearcher &&other) noexcept=default
 Default move constructor. More...
 
PointNeighborSearcheroperator= (const PointNeighborSearcher &other)=default
 Default copy assignment operator. More...
 
PointNeighborSearcheroperator= (PointNeighborSearcher &&other) noexcept=default
 Default move assignment operator. More...
 
virtual std::string TypeName () const =0
 Returns the type name of the derived class. More...
 
virtual void Build (const ConstArrayView1< Vector< double, N >> &points)
 Builds internal acceleration structure for given points list. More...
 
virtual void Build (const ConstArrayView1< Vector< double, N >> &points, double maxSearchRadius)=0
 
virtual void ForEachNearbyPoint (const Vector< double, N > &origin, double radius, const ForEachNearbyPointFunc &callback) const =0
 
virtual bool HasNearbyPoint (const Vector< double, N > &origin, double radius) const =0
 
virtual std::shared_ptr< PointNeighborSearcherClone () const =0
 Creates a new instance of the object with same properties than original. More...
 
- Public Member Functions inherited from CubbyFlow::Serializable
 Serializable ()=default
 Default constructor. More...
 
 Serializable (const Serializable &)=default
 Default copy constructor. More...
 
 Serializable (Serializable &&) noexcept=default
 Default move constructor. More...
 
virtual ~Serializable ()=default
 Default virtual destructor. More...
 
Serializableoperator= (const Serializable &)=default
 Default copy assignment operator. More...
 
Serializableoperator= (Serializable &&) noexcept=default
 Default move assignment operator. More...
 
virtual void Serialize (std::vector< uint8_t > *buffer) const =0
 Serializes this instance into the flat buffer. More...
 
virtual void Deserialize (const std::vector< uint8_t > &buffer)=0
 Deserializes this instance from the flat buffer. More...
 

Detailed Description

template<size_t N>
class CubbyFlow::PointNeighborSearcher< N >

Abstract base class for N-D neighbor point searcher.

This class provides interface for N-D neighbor point searcher. For given list of points, the class builds internal cache to accelerate the search. Once built, the data structure is used to search nearby points for given origin point.

Member Typedef Documentation

◆ ForEachNearbyPointFunc

template<size_t N>
using CubbyFlow::PointNeighborSearcher< N >::ForEachNearbyPointFunc = std::function<void(size_t, const Vector<double, N>&)>

Callback function for nearby search query. The first parameter is the index of the nearby point, and the second is the position of the point.

Constructor & Destructor Documentation

◆ PointNeighborSearcher() [1/3]

template<size_t N>
CubbyFlow::PointNeighborSearcher< N >::PointNeighborSearcher ( )
default

Default constructor.

◆ ~PointNeighborSearcher()

template<size_t N>
CubbyFlow::PointNeighborSearcher< N >::~PointNeighborSearcher ( )
overridedefault

Default virtual destructor.

◆ PointNeighborSearcher() [2/3]

template<size_t N>
CubbyFlow::PointNeighborSearcher< N >::PointNeighborSearcher ( const PointNeighborSearcher< N > &  other)
default

Default copy constructor.

◆ PointNeighborSearcher() [3/3]

template<size_t N>
CubbyFlow::PointNeighborSearcher< N >::PointNeighborSearcher ( PointNeighborSearcher< N > &&  other)
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ Build() [1/2]

template<size_t N>
virtual void CubbyFlow::PointNeighborSearcher< N >::Build ( const ConstArrayView1< Vector< double, N >> &  points)
virtual

Builds internal acceleration structure for given points list.

Reimplemented in CubbyFlow::PointParallelHashGridSearcher< N >.

◆ Build() [2/2]

template<size_t N>
virtual void CubbyFlow::PointNeighborSearcher< N >::Build ( const ConstArrayView1< Vector< double, N >> &  points,
double  maxSearchRadius 
)
pure virtual

Builds internal acceleration structure for given points list and max search radius.

Implemented in CubbyFlow::PointParallelHashGridSearcher< N >, CubbyFlow::PointHashGridSearcher< N >, CubbyFlow::PointSimpleListSearcher< N >, and CubbyFlow::PointKdTreeSearcher< N >.

◆ Clone()

template<size_t N>
virtual std::shared_ptr<PointNeighborSearcher> CubbyFlow::PointNeighborSearcher< N >::Clone ( ) const
pure virtual

Creates a new instance of the object with same properties than original.

Returns
Copy of this object.

Implemented in CubbyFlow::PointParallelHashGridSearcher< N >, CubbyFlow::PointHashGridSearcher< N >, CubbyFlow::PointSimpleListSearcher< N >, and CubbyFlow::PointKdTreeSearcher< N >.

◆ ForEachNearbyPoint()

template<size_t N>
virtual void CubbyFlow::PointNeighborSearcher< N >::ForEachNearbyPoint ( const Vector< double, N > &  origin,
double  radius,
const ForEachNearbyPointFunc callback 
) const
pure virtual

Invokes the callback function for each nearby point around the origin within given radius.

Parameters
[in]originThe origin position.
[in]radiusThe search radius.
[in]callbackThe callback function.

Implemented in CubbyFlow::PointParallelHashGridSearcher< N >, CubbyFlow::PointHashGridSearcher< N >, CubbyFlow::PointSimpleListSearcher< N >, and CubbyFlow::PointKdTreeSearcher< N >.

◆ HasNearbyPoint()

template<size_t N>
virtual bool CubbyFlow::PointNeighborSearcher< N >::HasNearbyPoint ( const Vector< double, N > &  origin,
double  radius 
) const
pure virtual

Returns true if there are any nearby points for given origin within radius.

Parameters
[in]originThe origin.
[in]radiusThe radius.
Returns
True if has nearby point, false otherwise.

Implemented in CubbyFlow::PointParallelHashGridSearcher< N >, CubbyFlow::PointHashGridSearcher< N >, CubbyFlow::PointSimpleListSearcher< N >, and CubbyFlow::PointKdTreeSearcher< N >.

◆ operator=() [1/2]

template<size_t N>
PointNeighborSearcher& CubbyFlow::PointNeighborSearcher< N >::operator= ( const PointNeighborSearcher< N > &  other)
default

Default copy assignment operator.

◆ operator=() [2/2]

template<size_t N>
PointNeighborSearcher& CubbyFlow::PointNeighborSearcher< N >::operator= ( PointNeighborSearcher< N > &&  other)
defaultnoexcept

Default move assignment operator.

◆ TypeName()

template<size_t N>
virtual std::string CubbyFlow::PointNeighborSearcher< N >::TypeName ( ) const
pure virtual

Returns the type name of the derived class.


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