Go to the documentation of this file.
7 #ifndef INCLUDE_JET_POINT_PARALLEL_HASH_GRID_SEARCHER3_H_
8 #define INCLUDE_JET_POINT_PARALLEL_HASH_GRID_SEARCHER3_H_
41 const Size3& resolution,
double gridSpacing);
96 const Vector3D& origin,
double radius)
const override;
106 const std::vector<size_t>&
keys()
const;
204 void serialize(std::vector<uint8_t>* buffer)
const override;
213 double _gridSpacing = 1.0;
215 std::vector<Vector3D> _points;
216 std::vector<size_t> _keys;
217 std::vector<size_t> _startIndexTable;
218 std::vector<size_t> _endIndexTable;
219 std::vector<size_t> _sortedIndices;
221 size_t getHashKeyFromPosition(
const Vector3D& position)
const;
223 void getNearbyKeys(
const Vector3D& position,
size_t* bucketIndices)
const;
227 typedef std::shared_ptr<PointParallelHashGridSearcher3>
253 Size3 _resolution{64, 64, 64};
254 double _gridSpacing = 1.0;
259 #endif // INCLUDE_JET_POINT_PARALLEL_HASH_GRID_SEARCHER3_H_
void forEachNearbyPoint(const Vector3D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
const std::vector< size_t > & endIndexTable() const
Returns the end index table.
PointParallelHashGridSearcher3(const Size3 &resolution, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
PointParallelHashGridSearcher3 build() const
Builds PointParallelHashGridSearcher3 instance.
PointParallelHashGridSearcher3 & operator=(const PointParallelHashGridSearcher3 &other)
Assignment operator.
1-D read-only array accessor class.
Definition: array_accessor1.h:184
static Builder builder()
Returns builder fox PointParallelHashGridSearcher3.
Point3< ssize_t > Point3I
Integer-type 3D point.
Definition: point3.h:306
const std::vector< size_t > & keys() const
Returns the hash key list.
PointParallelHashGridSearcher3(size_t resolutionX, size_t resolutionY, size_t resolutionZ, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
Point3I getBucketIndex(const Vector3D &position) const
std::shared_ptr< PointParallelHashGridSearcher3 > PointParallelHashGridSearcher3Ptr
Shared pointer for the PointParallelHashGridSearcher3 type.
Definition: point_parallel_hash_grid_searcher3.h:228
bool hasNearbyPoint(const Vector3D &origin, double radius) const override
const std::vector< size_t > & startIndexTable() const
Returns the start index table.
Definition: advection_solver2.h:18
PointNeighborSearcher3Ptr buildPointNeighborSearcher() const override
Returns shared pointer of PointNeighborSearcher3 type.
size_t getHashKeyFromBucketIndex(const Point3I &bucketIndex) const
void deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the neighbor searcher from the buffer.
Abstract base class for 3-D neighbor point searcher.
Definition: point_neighbor_searcher3.h:28
std::function< void(size_t, const Vector3D &)> ForEachNearbyPointFunc
Definition: point_neighbor_searcher3.h:33
#define JET_NEIGHBOR_SEARCHER3_TYPE_NAME(DerivedClassName)
Definition: point_neighbor_searcher3.h:95
3-D size class.
Definition: size3.h:19
PointNeighborSearcher3Ptr clone() const override
Creates a new instance of the object with same properties than original.
void set(const PointParallelHashGridSearcher3 &other)
Copy from the other instance.
Builder & withGridSpacing(double gridSpacing)
Returns builder with grid spacing.
3-D point class.
Definition: point3.h:23
void serialize(std::vector< uint8_t > *buffer) const override
Serializes the neighbor searcher into the buffer.
std::shared_ptr< PointNeighborSearcher3 > PointNeighborSearcher3Ptr
Shared pointer for the PointNeighborSearcher3 type.
Definition: point_neighbor_searcher3.h:82
Builder & withResolution(const Size3 &resolution)
Returns builder with resolution.
Parallel version of hash grid-based 3-D point searcher.
Definition: point_parallel_hash_grid_searcher3.h:24
Front-end to create PointParallelHashGridSearcher3 objects step by step.
Definition: point_parallel_hash_grid_searcher3.h:235
3-D vector class.
Definition: vector3.h:25
Abstract base class for 3-D point neighbor searcher builders.
Definition: point_neighbor_searcher3.h:85
PointParallelHashGridSearcher3(const PointParallelHashGridSearcher3 &other)
Copy constructor.
const std::vector< size_t > & sortedIndices() const
Returns the sorted indices of the points.
PointParallelHashGridSearcher3Ptr makeShared() const
Builds shared pointer of PointParallelHashGridSearcher3 instance.
void build(const ConstArrayAccessor1< Vector3D > &points) override
Builds internal acceleration structure for given points list.