CubbyFlow::PointHashGridSearcher3 Class Referencefinal

Hash grid-based 3-D point searcher. More...

#include <Core/Searcher/PointHashGridSearcher3.h>

Inheritance diagram for CubbyFlow::PointHashGridSearcher3:
CubbyFlow::PointNeighborSearcher3 CubbyFlow::Serializable

Classes

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

Public Member Functions

 PointHashGridSearcher3 (const Size3 &resolution, double gridSpacing)
 Constructs hash grid with given resolution and grid spacing. More...
 
 PointHashGridSearcher3 (size_t resolutionX, size_t resolutionY, size_t resolutionZ, double gridSpacing)
 Constructs hash grid with given resolution and grid spacing. More...
 
 PointHashGridSearcher3 (const PointHashGridSearcher3 &other)
 Copy constructor. More...
 
void Build (const ConstArrayAccessor1< Vector3D > &points) override
 Builds internal acceleration structure for given points list. More...
 
void ForEachNearbyPoint (const Vector3D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
 
bool HasNearbyPoint (const Vector3D &origin, double radius) const override
 
void Add (const Vector3D &point)
 Adds a single point to the hash grid. More...
 
const std::vector< std::vector< size_t > > & GetBuckets () const
 Returns the internal bucket. More...
 
size_t GetHashKeyFromBucketIndex (const Point3I &bucketIndex) const
 
Point3I GetBucketIndex (const Vector3D &position) const
 
PointNeighborSearcher3Ptr Clone () const override
 Creates a new instance of the object with same properties than original. More...
 
PointHashGridSearcher3operator= (const PointHashGridSearcher3 &other)
 Assignment operator. More...
 
void Set (const PointHashGridSearcher3 &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::PointNeighborSearcher3
 PointNeighborSearcher3 ()
 Default constructor. More...
 
virtual ~PointNeighborSearcher3 ()
 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 PointHashGridSearcher3. More...
 

Additional Inherited Members

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

Detailed Description

Hash grid-based 3-D point searcher.

This class implements 3-D point searcher by using hash grid for its internal acceleration data structure. Each point is recorded to its corresponding bucket where the hashing function is 3-D grid mapping.

Constructor & Destructor Documentation

◆ PointHashGridSearcher3() [1/3]

CubbyFlow::PointHashGridSearcher3::PointHashGridSearcher3 ( const Size3 resolution,
double  gridSpacing 
)

Constructs hash grid with given resolution and grid spacing.

This constructor takes hash grid resolution and its grid spacing as its input parameters. The grid spacing must be 2x or greater than search radius.

Parameters
[in]resolutionThe resolution.
[in]gridSpacingThe grid spacing.

◆ PointHashGridSearcher3() [2/3]

CubbyFlow::PointHashGridSearcher3::PointHashGridSearcher3 ( size_t  resolutionX,
size_t  resolutionY,
size_t  resolutionZ,
double  gridSpacing 
)

Constructs hash grid with given resolution and grid spacing.

This constructor takes hash grid resolution and its grid spacing as its input parameters. The grid spacing must be 2x or greater than search radius.

Parameters
[in]resolutionXThe resolution x.
[in]resolutionYThe resolution y.
[in]resolutionZThe resolution z.
[in]gridSpacingThe grid spacing.

◆ PointHashGridSearcher3() [3/3]

CubbyFlow::PointHashGridSearcher3::PointHashGridSearcher3 ( const PointHashGridSearcher3 other)

Copy constructor.

Member Function Documentation

◆ Add()

void CubbyFlow::PointHashGridSearcher3::Add ( const Vector3D point)

Adds a single point to the hash grid.

This function adds a single point to the hash grid for future queries. It can be used for a hash grid that is already built by calling function PointHashGridSearcher3::build.

Parameters
[in]pointThe point to be added.

◆ Build()

void CubbyFlow::PointHashGridSearcher3::Build ( const ConstArrayAccessor1< Vector3D > &  points)
overridevirtual

Builds internal acceleration structure for given points list.

Implements CubbyFlow::PointNeighborSearcher3.

◆ Clone()

PointNeighborSearcher3Ptr CubbyFlow::PointHashGridSearcher3::Clone ( ) const
overridevirtual

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

Returns
Copy of this object.

Implements CubbyFlow::PointNeighborSearcher3.

◆ Deserialize()

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

Deserializes the neighbor searcher from the buffer.

Implements CubbyFlow::Serializable.

◆ ForEachNearbyPoint()

void CubbyFlow::PointHashGridSearcher3::ForEachNearbyPoint ( const Vector3D 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::PointNeighborSearcher3.

◆ GetBucketIndex()

Point3I CubbyFlow::PointHashGridSearcher3::GetBucketIndex ( const Vector3D position) const

Gets the bucket index from a point.

Parameters
[in]positionThe position of the point.
Returns
The bucket index.

◆ GetBuckets()

const std::vector<std::vector<size_t> >& CubbyFlow::PointHashGridSearcher3::GetBuckets ( ) const

Returns the internal bucket.

A bucket is a list of point indices that has same hash value. This function returns the (immutable) internal bucket structure.

Returns
List of buckets.

◆ GetBuilder()

static Builder CubbyFlow::PointHashGridSearcher3::GetBuilder ( )
static

Returns builder fox PointHashGridSearcher3.

◆ GetHashKeyFromBucketIndex()

size_t CubbyFlow::PointHashGridSearcher3::GetHashKeyFromBucketIndex ( const Point3I bucketIndex) const

Returns the hash value for given 3-D bucket index.

Parameters
[in]bucketIndexThe bucket index.
Returns
The hash key from bucket index.

◆ HasNearbyPoint()

bool CubbyFlow::PointHashGridSearcher3::HasNearbyPoint ( const Vector3D 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::PointNeighborSearcher3.

◆ operator=()

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

Assignment operator.

◆ Serialize()

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

Serializes the neighbor searcher into the buffer.

Implements CubbyFlow::Serializable.

◆ Set()

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

Copy from the other instance.


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