CubbyFlow::PointSimpleListSearcher< N > Class Template Referencefinal

Simple ad-hoc N-D point searcher. More...

#include <Core/Searcher/PointSimpleListSearcher.hpp>

Inheritance diagram for CubbyFlow::PointSimpleListSearcher< N >:
CubbyFlow::PointNeighborSearcher< N > CubbyFlow::Serializable

Classes

class  Builder
 Front-end to create PointSimpleListSearcher objects step by step. More...
 

Public Member Functions

 PointSimpleListSearcher ()=default
 Default constructor. More...
 
 ~PointSimpleListSearcher () override=default
 Default virtual destructor. More...
 
 PointSimpleListSearcher (const PointSimpleListSearcher &other)
 Copy constructor. More...
 
 PointSimpleListSearcher (PointSimpleListSearcher &&other) noexcept
 Move constructor. More...
 
PointSimpleListSearcheroperator= (const PointSimpleListSearcher &other)
 Copy assignment operator. More...
 
PointSimpleListSearcheroperator= (PointSimpleListSearcher &&other) noexcept
 Move assignment operator. More...
 
void Build (const ConstArrayView1< Vector< double, N >> &points, double maxSearchRadius) override
 Builds internal structure for given points list and max search radius. More...
 
void ForEachNearbyPoint (const Vector< double, N > &origin, double radius, const ForEachNearbyPointFunc &callback) const override
 
bool HasNearbyPoint (const Vector< double, N > &origin, double radius) const override
 
std::shared_ptr< PointNeighborSearcher< N > > Clone () const override
 Creates a new instance of the object with same properties than original. More...
 
void Set (const PointSimpleListSearcher &other)
 Copy from the other instance. More...
 
void Serialize (std::vector< uint8_t > *buffer) const override
 Serializes the neighbor searcher into the buffer. More...
 
void Deserialize (const std::vector< uint8_t > &buffer) override
 Deserializes the neighbor searcher from the buffer. More...
 
- Public Member Functions inherited from CubbyFlow::PointNeighborSearcher< N >
 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...
 
- 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...
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder fox PointSimpleListSearcher. More...
 

Additional Inherited Members

- Public Types inherited from CubbyFlow::PointNeighborSearcher< N >
using ForEachNearbyPointFunc = std::function< void(size_t, const Vector< double, N > &)>
 

Detailed Description

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

Simple ad-hoc N-D point searcher.

This class implements N-D point searcher simply by looking up every point in the list. Thus, this class is not ideal for searches involving large number of points, but only for small set of items.

Constructor & Destructor Documentation

◆ PointSimpleListSearcher() [1/3]

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

Default constructor.

◆ ~PointSimpleListSearcher()

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

Default virtual destructor.

◆ PointSimpleListSearcher() [2/3]

Copy constructor.

◆ PointSimpleListSearcher() [3/3]

template<size_t N>
CubbyFlow::PointSimpleListSearcher< N >::PointSimpleListSearcher ( PointSimpleListSearcher< N > &&  other)
noexcept

Move constructor.

Member Function Documentation

◆ Build()

template<size_t N>
void CubbyFlow::PointSimpleListSearcher< N >::Build ( const ConstArrayView1< Vector< double, N >> &  points,
double  maxSearchRadius 
)
overridevirtual

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

For this class, this function simply copies the given point list to the internal list. The max search radius will be unused.

Parameters
[in]pointsThe points to search.
[in]maxSearchRadiusMax search radius (ignored).

Implements CubbyFlow::PointNeighborSearcher< N >.

◆ Clone()

template<size_t N>
std::shared_ptr<PointNeighborSearcher<N> > CubbyFlow::PointSimpleListSearcher< N >::Clone ( ) const
overridevirtual

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

Returns
Copy of this object.

Implements CubbyFlow::PointNeighborSearcher< N >.

◆ Deserialize()

template<size_t N>
void CubbyFlow::PointSimpleListSearcher< N >::Deserialize ( const std::vector< uint8_t > &  buffer)
overridevirtual

Deserializes the neighbor searcher from the buffer.

Implements CubbyFlow::Serializable.

◆ ForEachNearbyPoint()

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

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.

Implements CubbyFlow::PointNeighborSearcher< N >.

◆ GetBuilder()

template<size_t N>
static Builder CubbyFlow::PointSimpleListSearcher< N >::GetBuilder ( )
static

Returns builder fox PointSimpleListSearcher.

◆ HasNearbyPoint()

template<size_t N>
bool CubbyFlow::PointSimpleListSearcher< N >::HasNearbyPoint ( const Vector< double, N > &  origin,
double  radius 
) const
overridevirtual

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.

Implements CubbyFlow::PointNeighborSearcher< N >.

◆ operator=() [1/2]

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

Copy assignment operator.

◆ operator=() [2/2]

template<size_t N>
PointSimpleListSearcher& CubbyFlow::PointSimpleListSearcher< N >::operator= ( PointSimpleListSearcher< N > &&  other)
noexcept

Move assignment operator.

◆ Serialize()

template<size_t N>
void CubbyFlow::PointSimpleListSearcher< N >::Serialize ( std::vector< uint8_t > *  buffer) const
overridevirtual

Serializes the neighbor searcher into the buffer.

Implements CubbyFlow::Serializable.

◆ Set()

template<size_t N>
void CubbyFlow::PointSimpleListSearcher< N >::Set ( const PointSimpleListSearcher< N > &  other)

Copy from the other instance.


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