Go to the documentation of this file.
7 #ifndef INCLUDE_JET_POINT_HASH_GRID_SEARCHER3_H_
8 #define INCLUDE_JET_POINT_HASH_GRID_SEARCHER3_H_
90 const Vector3D& origin,
double radius)
const override;
111 const std::vector<std::vector<size_t>>&
buckets()
const;
146 void serialize(std::vector<uint8_t>* buffer)
const override;
155 double _gridSpacing = 1.0;
157 std::vector<Vector3D> _points;
158 std::vector<std::vector<size_t>> _buckets;
160 size_t getHashKeyFromPosition(
const Vector3D& position)
const;
162 void getNearbyKeys(
const Vector3D& position,
size_t* bucketIndices)
const;
190 Size3 _resolution{64, 64, 64};
191 double _gridSpacing = 1.0;
196 #endif // INCLUDE_JET_POINT_HASH_GRID_SEARCHER3_H_
1-D read-only array accessor class.
Definition: array_accessor1.h:184
bool hasNearbyPoint(const Vector3D &origin, double radius) const override
Front-end to create PointHashGridSearcher3 objects step by step.
Definition: point_hash_grid_searcher3.h:172
PointHashGridSearcher3 build() const
Builds PointHashGridSearcher3 instance.
PointHashGridSearcher3 & operator=(const PointHashGridSearcher3 &other)
Assignment operator.
Point3< ssize_t > Point3I
Integer-type 3D point.
Definition: point3.h:306
Point3I getBucketIndex(const Vector3D &position) const
void forEachNearbyPoint(const Vector3D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
PointNeighborSearcher3Ptr clone() const override
Creates a new instance of the object with same properties than original.
std::shared_ptr< PointHashGridSearcher3 > PointHashGridSearcher3Ptr
Shared pointer for the PointHashGridSearcher3 type.
Definition: point_hash_grid_searcher3.h:166
void set(const PointHashGridSearcher3 &other)
Copy from the other instance.
PointHashGridSearcher3Ptr makeShared() const
Builds shared pointer of PointHashGridSearcher3 instance.
Builder & withGridSpacing(double gridSpacing)
Returns builder with grid spacing.
static Builder builder()
Returns builder fox PointHashGridSearcher3.
Definition: advection_solver2.h:18
PointHashGridSearcher3(size_t resolutionX, size_t resolutionY, size_t resolutionZ, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
void deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the neighbor searcher from the buffer.
PointHashGridSearcher3(const Size3 &resolution, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
size_t getHashKeyFromBucketIndex(const Point3I &bucketIndex) const
Abstract base class for 3-D neighbor point searcher.
Definition: point_neighbor_searcher3.h:28
void add(const Vector3D &point)
Adds a single point to the hash grid.
std::function< void(size_t, const Vector3D &)> ForEachNearbyPointFunc
Definition: point_neighbor_searcher3.h:33
void build(const ConstArrayAccessor1< Vector3D > &points) override
Builds internal acceleration structure for given points list.
#define JET_NEIGHBOR_SEARCHER3_TYPE_NAME(DerivedClassName)
Definition: point_neighbor_searcher3.h:95
3-D size class.
Definition: size3.h:19
3-D point class.
Definition: point3.h:23
std::shared_ptr< PointNeighborSearcher3 > PointNeighborSearcher3Ptr
Shared pointer for the PointNeighborSearcher3 type.
Definition: point_neighbor_searcher3.h:82
const std::vector< std::vector< size_t > > & buckets() const
Returns the internal bucket.
3-D vector class.
Definition: vector3.h:25
Builder & withResolution(const Size3 &resolution)
Returns builder with resolution.
Hash grid-based 3-D point searcher.
Definition: point_hash_grid_searcher3.h:25
Abstract base class for 3-D point neighbor searcher builders.
Definition: point_neighbor_searcher3.h:85
void serialize(std::vector< uint8_t > *buffer) const override
Serializes the neighbor searcher into the buffer.
PointNeighborSearcher3Ptr buildPointNeighborSearcher() const override
Returns shared pointer of PointHashGridSearcher3 type.
PointHashGridSearcher3(const PointHashGridSearcher3 &other)
Copy constructor.