Jet
v1.3.3
|
Hash grid-based 3-D point searcher. More...
#include <jet/point_hash_grid_searcher3.h>
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 > > & | buckets () 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... | |
PointHashGridSearcher3 & | operator= (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... | |
![]() | |
PointNeighborSearcher3 () | |
Default constructor. More... | |
virtual | ~PointNeighborSearcher3 () |
Destructor. More... | |
virtual std::string | typeName () const =0 |
Returns the type name of the derived class. More... | |
![]() | |
Serializable ()=default | |
virtual | ~Serializable ()=default |
Static Public Member Functions | |
static Builder | builder () |
Returns builder fox PointHashGridSearcher3. More... | |
Additional Inherited Members | |
![]() | |
typedef std::function< void(size_t, const Vector3D &)> | ForEachNearbyPointFunc |
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.
jet::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.
[in] | resolution | The resolution. |
[in] | gridSpacing | The grid spacing. |
jet::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.
[in] | resolutionX | The resolution x. |
[in] | resolutionY | The resolution y. |
[in] | resolutionY | The resolution z. |
[in] | gridSpacing | The grid spacing. |
jet::PointHashGridSearcher3::PointHashGridSearcher3 | ( | const PointHashGridSearcher3 & | other | ) |
Copy constructor.
void jet::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.
[in] | point | The point to be added. |
const std::vector<std::vector<size_t> >& jet::PointHashGridSearcher3::buckets | ( | ) | 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.
|
overridevirtual |
Builds internal acceleration structure for given points list.
Implements jet::PointNeighborSearcher3.
|
static |
Returns builder fox PointHashGridSearcher3.
|
overridevirtual |
Creates a new instance of the object with same properties than original.
Implements jet::PointNeighborSearcher3.
|
overridevirtual |
Deserializes the neighbor searcher from the buffer.
Implements jet::Serializable.
|
overridevirtual |
Invokes the callback function for each nearby point around the origin within given radius.
[in] | origin | The origin position. |
[in] | radius | The search radius. |
[in] | callback | The callback function. |
Implements jet::PointNeighborSearcher3.
Gets the bucket index from a point.
[in] | position | The position of the point. |
size_t jet::PointHashGridSearcher3::getHashKeyFromBucketIndex | ( | const Point3I & | bucketIndex | ) | const |
Returns the hash value for given 3-D bucket index.
[in] | bucketIndex | The bucket index. |
|
overridevirtual |
Returns true if there are any nearby points for given origin within radius.
[in] | origin | The origin. |
[in] | radius | The radius. |
Implements jet::PointNeighborSearcher3.
PointHashGridSearcher3& jet::PointHashGridSearcher3::operator= | ( | const PointHashGridSearcher3 & | other | ) |
Assignment operator.
|
overridevirtual |
Serializes the neighbor searcher into the buffer.
Implements jet::Serializable.
void jet::PointHashGridSearcher3::set | ( | const PointHashGridSearcher3 & | other | ) |
Copy from the other instance.