Go to the documentation of this file.
7 #ifndef INCLUDE_JET_POINT_PARALLEL_HASH_GRID_SEARCHER2_H_
8 #define INCLUDE_JET_POINT_PARALLEL_HASH_GRID_SEARCHER2_H_
15 class PointParallelHashGridSearcher2Tests;
43 const Size2& resolution,
double gridSpacing);
96 const Vector2D& origin,
double radius)
const override;
106 const std::vector<size_t>&
keys()
const;
204 void serialize(std::vector<uint8_t>* buffer)
const override;
215 double _gridSpacing = 1.0;
217 std::vector<Vector2D> _points;
218 std::vector<size_t> _keys;
219 std::vector<size_t> _startIndexTable;
220 std::vector<size_t> _endIndexTable;
221 std::vector<size_t> _sortedIndices;
223 size_t getHashKeyFromPosition(
const Vector2D& position)
const;
225 void getNearbyKeys(
const Vector2D& position,
size_t* bucketIndices)
const;
229 typedef std::shared_ptr<PointParallelHashGridSearcher2>
255 Size2 _resolution{64, 64};
256 double _gridSpacing = 1.0;
261 #endif // INCLUDE_JET_POINT_PARALLEL_HASH_GRID_SEARCHER2_H_
2-D point class.
Definition: point2.h:23
void set(const PointParallelHashGridSearcher2 &other)
Copy from the other instance.
Point2< ssize_t > Point2I
Integer-type 2D point.
Definition: point2.h:298
#define JET_NEIGHBOR_SEARCHER2_TYPE_NAME(DerivedClassName)
Definition: point_neighbor_searcher2.h:95
std::shared_ptr< PointParallelHashGridSearcher2 > PointParallelHashGridSearcher2Ptr
Shared pointer for the PointParallelHashGridSearcher2 type.
Definition: point_parallel_hash_grid_searcher2.h:230
1-D read-only array accessor class.
Definition: array_accessor1.h:184
std::shared_ptr< PointNeighborSearcher2 > PointNeighborSearcher2Ptr
Shared pointer for the PointNeighborSearcher2 type.
Definition: point_neighbor_searcher2.h:82
void forEachNearbyPoint(const Vector2D &origin, double radius, const ForEachNearbyPointFunc &callback) const override
size_t getHashKeyFromBucketIndex(const Point2I &bucketIndex) const
PointParallelHashGridSearcher2(const Size2 &resolution, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
Point2I getBucketIndex(const Vector2D &position) const
PointParallelHashGridSearcher2 & operator=(const PointParallelHashGridSearcher2 &other)
Assignment operator.
PointParallelHashGridSearcher2 build() const
Builds PointParallelHashGridSearcher2 instance.
Definition: advection_solver2.h:18
Builder & withResolution(const Size2 &resolution)
Returns builder with resolution.
PointNeighborSearcher2Ptr clone() const override
Creates a new instance of the object with same properties than original.
const std::vector< size_t > & sortedIndices() const
Returns the sorted indices of the points.
friend class PointParallelHashGridSearcher2Tests
Definition: point_parallel_hash_grid_searcher2.h:213
PointParallelHashGridSearcher2(size_t resolutionX, size_t resolutionY, double gridSpacing)
Constructs hash grid with given resolution and grid spacing.
Parallel version of hash grid-based 2-D point searcher.
Definition: point_parallel_hash_grid_searcher2.h:26
Front-end to create PointParallelHashGridSearcher2 objects step by step.
Definition: point_parallel_hash_grid_searcher2.h:237
2-D vector class.
Definition: vector2.h:24
static Builder builder()
Returns builder fox PointParallelHashGridSearcher2.
std::function< void(size_t, const Vector2D &)> ForEachNearbyPointFunc
Definition: point_neighbor_searcher2.h:33
const std::vector< size_t > & endIndexTable() const
Returns the end index table.
PointParallelHashGridSearcher2(const PointParallelHashGridSearcher2 &other)
Copy constructor.
PointNeighborSearcher2Ptr buildPointNeighborSearcher() const override
Returns shared pointer of PointNeighborSearcher3 type.
Abstract base class for 2-D point neighbor searcher builders.
Definition: point_neighbor_searcher2.h:85
2-D size class.
Definition: size2.h:19
const std::vector< size_t > & startIndexTable() const
Returns the start index table.
bool hasNearbyPoint(const Vector2D &origin, double radius) const override
void build(const ConstArrayAccessor1< Vector2D > &points) override
Builds internal acceleration structure for given points list.
void serialize(std::vector< uint8_t > *buffer) const override
Serializes the neighbor searcher into the buffer.
Abstract base class for 2-D neighbor point searcher.
Definition: point_neighbor_searcher2.h:28
const std::vector< size_t > & keys() const
Returns the hash key list.
PointParallelHashGridSearcher2Ptr makeShared() const
Builds shared pointer of PointParallelHashGridSearcher2 instance.
void deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the neighbor searcher from the buffer.
Builder & withGridSpacing(double gridSpacing)
Returns builder with grid spacing.