CubbyFlow::PointNeighborSearcher2 Class Referenceabstract

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

#include <Core/Searcher/PointNeighborSearcher2.h>

Inheritance diagram for CubbyFlow::PointNeighborSearcher2:
CubbyFlow::Serializable CubbyFlow::PointHashGridSearcher2 CubbyFlow::PointKdTreeSearcher2 CubbyFlow::PointParallelHashGridSearcher2 CubbyFlow::PointSimpleListSearcher2

Public Types

using ForEachNearbyPointFunc = std::function< void(size_t, const Vector2D &)>
 

Public Member Functions

 PointNeighborSearcher2 ()
 Default constructor. More...
 
virtual ~PointNeighborSearcher2 ()
 Destructor. More...
 
virtual std::string TypeName () const =0
 Returns the type name of the derived class. More...
 
virtual void Build (const ConstArrayAccessor1< Vector2D > &points)=0
 Builds internal acceleration structure for given points list. More...
 
virtual void ForEachNearbyPoint (const Vector2D &origin, double radius, const ForEachNearbyPointFunc &callback) const =0
 
virtual bool HasNearbyPoint (const Vector2D &origin, double radius) const =0
 
virtual std::shared_ptr< PointNeighborSearcher2Clone () const =0
 Creates a new instance of the object with same properties than original. More...
 
- Public Member Functions inherited from CubbyFlow::Serializable
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

Abstract base class for 2-D neighbor point searcher.

This class provides interface for 2-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

using CubbyFlow::PointNeighborSearcher2::ForEachNearbyPointFunc = std::function<void(size_t, const Vector2D&)>

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

◆ PointNeighborSearcher2()

CubbyFlow::PointNeighborSearcher2::PointNeighborSearcher2 ( )

Default constructor.

◆ ~PointNeighborSearcher2()

virtual CubbyFlow::PointNeighborSearcher2::~PointNeighborSearcher2 ( )
virtual

Destructor.

Member Function Documentation

◆ Build()

virtual void CubbyFlow::PointNeighborSearcher2::Build ( const ConstArrayAccessor1< Vector2D > &  points)
pure virtual

◆ Clone()

virtual std::shared_ptr<PointNeighborSearcher2> CubbyFlow::PointNeighborSearcher2::Clone ( ) const
pure virtual

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

Returns
Copy of this object.

Implemented in CubbyFlow::PointParallelHashGridSearcher2, CubbyFlow::PointHashGridSearcher2, CubbyFlow::PointSimpleListSearcher2, and CubbyFlow::PointKdTreeSearcher2.

◆ ForEachNearbyPoint()

virtual void CubbyFlow::PointNeighborSearcher2::ForEachNearbyPoint ( const Vector2D 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::PointParallelHashGridSearcher2, CubbyFlow::PointHashGridSearcher2, CubbyFlow::PointSimpleListSearcher2, and CubbyFlow::PointKdTreeSearcher2.

◆ HasNearbyPoint()

virtual bool CubbyFlow::PointNeighborSearcher2::HasNearbyPoint ( const Vector2D 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::PointParallelHashGridSearcher2, CubbyFlow::PointHashGridSearcher2, CubbyFlow::PointSimpleListSearcher2, and CubbyFlow::PointKdTreeSearcher2.

◆ TypeName()

virtual std::string CubbyFlow::PointNeighborSearcher2::TypeName ( ) const
pure virtual

Returns the type name of the derived class.


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