12 #include <nanoflann.hpp>
22 #define HOST_DEVICE __host__ __device__
29 return x * 73856096 ^
y * 193649663 ^
z * 83492791;
41 template <
class TVecf>
43 const TVecf& pos,
const typename TVecf::Scalar_t& inv_voxel_size) {
44 TVecf ref_coord = pos * inv_voxel_size;
56 Adaptor(
size_t num_points,
const T*
const data)
57 : num_points(num_points),
data(
data) {}
62 return data[3 * idx + dim];
75 template <
int METRIC,
class T>
80 typedef nanoflann::L2_Adaptor<T, Adaptor<T>>
Adaptor_t;
85 typedef nanoflann::L1_Adaptor<T, Adaptor<T>>
Adaptor_t;
Adaptor(size_t num_points, const T *const data)
size_t kdtree_get_point_count() const
T kdtree_get_pt(const size_t idx, int dim) const
bool kdtree_get_bbox(BBOX &) const
utility::MiniVec< int, 3 > ComputeVoxelIndex(const TVecf &pos, const typename TVecf::Scalar_t &inv_voxel_size)
size_t SpatialHash(int x, int y, int z)
Spatial hashing function for integer coordinates.
MiniVec< float, N > floor(const MiniVec< float, N > &a)
Generic file read and write utility for python interface.
nanoflann::L1_Adaptor< T, Adaptor< T > > Adaptor_t
nanoflann::L2_Adaptor< T, Adaptor< T > > Adaptor_t