CubbyFlow::PointSimpleListSearcher2 Class Referencefinal

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

#include <Core/Searcher/PointSimpleListSearcher2.h>

Inheritance diagram for CubbyFlow::PointSimpleListSearcher2:
CubbyFlow::PointNeighborSearcher2 CubbyFlow::Serializable

Classes

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

Public Member Functions

 PointSimpleListSearcher2 ()
 Default constructor. More...
 
 PointSimpleListSearcher2 (const PointSimpleListSearcher2 &other)
 Copy constructor. More...
 
void Build (const ConstArrayAccessor1< Vector2D > &points) override
 Builds internal structure for given points list. More...
 
void ForEachNearbyPoint (const Vector2D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
 
bool HasNearbyPoint (const Vector2D &origin, double radius) const override
 
PointNeighborSearcher2Ptr Clone () const override
 Creates a new instance of the object with same properties than original. More...
 
PointSimpleListSearcher2operator= (const PointSimpleListSearcher2 &other)
 Assignment operator. More...
 
void Set (const PointSimpleListSearcher2 &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::PointNeighborSearcher2
 PointNeighborSearcher2 ()
 Default constructor. More...
 
virtual ~PointNeighborSearcher2 ()
 Destructor. More...
 
virtual std::string TypeName () const =0
 Returns the type name of the derived class. More...
 

Static Public Member Functions

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

Additional Inherited Members

- Public Types inherited from CubbyFlow::PointNeighborSearcher2
using ForEachNearbyPointFunc = std::function< void(size_t, const Vector2D &)>
 

Detailed Description

Simple ad-hoc 2-D point searcher.

This class implements 2-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

◆ PointSimpleListSearcher2() [1/2]

CubbyFlow::PointSimpleListSearcher2::PointSimpleListSearcher2 ( )

Default constructor.

◆ PointSimpleListSearcher2() [2/2]

CubbyFlow::PointSimpleListSearcher2::PointSimpleListSearcher2 ( const PointSimpleListSearcher2 other)

Copy constructor.

Member Function Documentation

◆ Build()

void CubbyFlow::PointSimpleListSearcher2::Build ( const ConstArrayAccessor1< Vector2D > &  points)
overridevirtual

Builds internal structure for given points list.

For this class, this function simply copies the given point list to the internal list.

Parameters
[in]pointsThe points to search.

Implements CubbyFlow::PointNeighborSearcher2.

◆ Clone()

PointNeighborSearcher2Ptr CubbyFlow::PointSimpleListSearcher2::Clone ( ) const
overridevirtual

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

Returns
Copy of this object.

Implements CubbyFlow::PointNeighborSearcher2.

◆ Deserialize()

void CubbyFlow::PointSimpleListSearcher2::Deserialize ( const std::vector< uint8_t > &  buffer)
overridevirtual

Deserializes the neighbor searcher from the buffer.

Implements CubbyFlow::Serializable.

◆ ForEachNearbyPoint()

void CubbyFlow::PointSimpleListSearcher2::ForEachNearbyPoint ( const Vector2D 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::PointNeighborSearcher2.

◆ GetBuilder()

static Builder CubbyFlow::PointSimpleListSearcher2::GetBuilder ( )
static

Returns builder fox PointSimpleListSearcher2.

◆ HasNearbyPoint()

bool CubbyFlow::PointSimpleListSearcher2::HasNearbyPoint ( const Vector2D 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::PointNeighborSearcher2.

◆ operator=()

PointSimpleListSearcher2& CubbyFlow::PointSimpleListSearcher2::operator= ( const PointSimpleListSearcher2 other)

Assignment operator.

◆ Serialize()

void CubbyFlow::PointSimpleListSearcher2::Serialize ( std::vector< uint8_t > *  buffer) const
overridevirtual

Serializes the neighbor searcher into the buffer.

Implements CubbyFlow::Serializable.

◆ Set()

void CubbyFlow::PointSimpleListSearcher2::Set ( const PointSimpleListSearcher2 other)

Copy from the other instance.


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