12#ifndef EBGEOMETRY_POINTCLOUDHASHGRID_HPP
13#define EBGEOMETRY_POINTCLOUDHASHGRID_HPP
141 inline std::vector<Hit>
152 return m_positions.size();
166 return m_positions.at(this->
base(), a_index);
209 storeArrays(
Pool& a_pool,
210 const std::vector<
Vec3T<T>>& a_positions,
211 const std::vector<std::uint32_t>& a_cellStart,
212 const std::vector<std::uint32_t>& a_cellPoints);
223 cellCoord(T a_x, T a_lo,
int a_n)
const noexcept;
234 cellIndex(
int a_ix,
int a_iy,
int a_iz)
const noexcept;
243 cellIndexOf(
const Vec3T<T>& a_p)
const noexcept;
256 query(
const Vec3T<T>& a_query, std::size_t a_k,
Hit* a_out, uint32_t a_exclude)
const noexcept;
291 int m_nx = 1, m_ny = 1, m_nz = 1;
298static_assert(std::is_trivially_copyable_v<PointCloudHashGrid<float>>,
299 "PointCloudHashGrid<float> must be trivially copyable");
300static_assert(std::is_trivially_copyable_v<PointCloudHashGrid<double>>,
301 "PointCloudHashGrid<double> must be trivially copyable");
305#include "EBGeometry_PointCloudHashGridImplem.hpp"
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
#define EBGEOMETRY_EXPECT(cond)
Runtime precondition assertion for EBGeometry.
Definition EBGeometry_Macros.hpp:155
Scalar helpers and numeric limits that compile for both host and device.
Placement-independent POD array views for the GPU memory foundation.
Query results and helpers shared by the point-cloud search structures.
Growable bump arena for the GPU memory foundation.
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
A uniform spatial grid specialized for point clouds, with a fast build and turnkey queries.
Definition EBGeometry_PointCloudHashGrid.hpp:65
std::vector< Hit > allNearestNeighbors(std::size_t a_k=1) const
For every point, its a_k nearest other points (the k-nearest-neighbor graph).
PointCloudHashGrid deepCopy(Pool &a_dstPool) const
Duplicate this object's storage into a_dstPool.
const Vec3T< T > & position(uint32_t a_index) const noexcept
Position of the point with the given cloud index.
Definition EBGeometry_PointCloudHashGrid.hpp:162
Hit nearestNeighbor(uint32_t a_point) const noexcept
Nearest other point to a point already in the cloud.
std::size_t numPoints() const noexcept
Number of points in the cloud.
Definition EBGeometry_PointCloudHashGrid.hpp:150
PointCloudHashGrid rebasedView(const Pool &a_pool) const noexcept
Produce a copy of this object that resolves against a_pool.
PointCloudHashGrid()=delete
No default construction – a point cloud is required.
PointCloudHashGrid(Pool &a_pool, const std::vector< Vec3T< T > > &a_positions, T a_targetPerCell=T(1))
Build a uniform grid over a point cloud.
std::size_t nearestNeighbors(uint32_t a_point, std::size_t a_k, Hit *a_out) const noexcept
The a_k nearest other points to a point already in the cloud, nearest first.
std::size_t closestPoints(const Vec3T< T > &a_query, std::size_t a_k, Hit *a_out) const noexcept
The a_k closest cloud points to an arbitrary query point, nearest first.
void * base() noexcept
The base address this object's arrays are offsets from; see PoolHandle::base().
Definition EBGeometry_Pool.hpp:575
Hit closestPoint(const Vec3T< T > &a_query) const noexcept
Closest cloud point to an arbitrary query point.
Base of every pool-resident handle: the one PoolLocation its arrays resolve against.
Definition EBGeometry_Pool.hpp:499
void * base() noexcept
The base address this handle's offsets resolve against; see PoolLocation::base().
Definition EBGeometry_Pool.hpp:575
Growable bump arena over a MemoryResource.
Definition EBGeometry_Pool.hpp:183
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Placement-independent descriptor of a POD array inside a Pool.
Definition EBGeometry_PODVector.hpp:119
One query result: the cloud index of a matched point and its squared distance.
Definition EBGeometry_PointCloud.hpp:53