PointHashGridSearcher2.h
Go to the documentation of this file.
Point2I GetBucketIndex(const Vector2D &position) const
std::shared_ptr< PointHashGridSearcher2 > PointHashGridSearcher2Ptr
Shared pointer for the PointHashGridSearcher2 type.
Definition: PointHashGridSearcher2.h:162
Front-end to create PointHashGridSearcher2 objects step by step.
Definition: PointHashGridSearcher2.h:167
Builder & WithGridSpacing(double gridSpacing)
Returns builder with grid spacing.
void Add(const Vector2D &point)
Adds a single point to the hash grid.
PointNeighborSearcher2Ptr Clone() const override
Creates a new instance of the object with same properties than original.
PointHashGridSearcher2 & operator=(const PointHashGridSearcher2 &other)
Assignment operator.
const std::vector< std::vector< size_t > > & GetBuckets() const
Returns the internal bucket.
std::function< void(size_t, const Vector2D &)> ForEachNearbyPointFunc
Definition: PointNeighborSearcher2.h:34
#define CUBBYFLOW_NEIGHBOR_SEARCHER2_TYPE_NAME(DerivedClassName)
Definition: PointNeighborSearcher2.h:94
1-D read-only array accessor class.
Definition: ArrayAccessor1.h:185
void Set(const PointHashGridSearcher2 &other)
Copy from the other instance.
Abstract base class for 2-D point neighbor searcher builders.
Definition: PointNeighborSearcher2.h:82
Definition: pybind11Utils.h:24
Abstract base class for 2-D neighbor point searcher.
Definition: PointNeighborSearcher2.h:29
void Build(const ConstArrayAccessor1< Vector2D > &points) override
Builds internal acceleration structure for given points list.
void ForEachNearbyPoint(const Vector2D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
PointHashGridSearcher2 Build() const
Builds PointHashGridSearcher2 instance.
void Deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the neighbor searcher from the buffer.
bool HasNearbyPoint(const Vector2D &origin, double radius) const override
PointNeighborSearcher2Ptr BuildPointNeighborSearcher() const override
Returns shared pointer of PointNeighborSearcher2 type.
PointHashGridSearcher2(const Size2 &resolution, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
static Builder GetBuilder()
Returns builder fox PointHashGridSearcher2.
std::shared_ptr< PointNeighborSearcher2 > PointNeighborSearcher2Ptr
Shared pointer for the PointNeighborSearcher2 type.
Definition: PointNeighborSearcher2.h:79
Builder & WithResolution(const Size2 &resolution)
Returns builder with resolution.
size_t GetHashKeyFromBucketIndex(const Point2I &bucketIndex) const
Hash grid-based 2-D point searcher.
Definition: PointHashGridSearcher2.h:26
void Serialize(std::vector< uint8_t > *buffer) const override
Serializes the neighbor searcher into the buffer.
PointHashGridSearcher2Ptr MakeShared() const
Builds shared pointer of PointHashGridSearcher2 instance.