33 impl_->pts_voxels.clear();
40 const mrpt::maps::CPointsMap& p)
45 const auto& xs = p.getPointsBufferRef_x();
46 const auto& ys = p.getPointsBufferRef_y();
47 const auto& zs = p.getPointsBufferRef_z();
48 const auto npts = xs.size();
50 auto& pts_voxels =
impl_->pts_voxels;
52 pts_voxels.reserve(pts_voxels.size() + npts);
54 for (std::size_t i = 0; i < npts; i++)
62 auto itVoxel = pts_voxels.find(vxl_idx);
64 if (itVoxel != pts_voxels.end())
67 auto& vx =
const_cast<voxel_t&
>(itVoxel->second);
69 if (vx.pointCount == 0)
70 vx = {mrpt::math::TPoint3Df(
x, y, z), i, &p, 1};
77 pts_voxels[vxl_idx] = {mrpt::math::TPoint3Df(
x, y, z), i, &p, 1};
85 impl_->pts_voxels.min_load_factor(0.01
f);
86 impl_->pts_voxels.clear();
93 for (
const auto& [idx, vxl] :
impl_->pts_voxels) userCode(idx, vxl);
98 return impl_->pts_voxels.size();