7 Cell& cell = map[idxs];
14 for (
const Vector& p : points) {
25 for (
const auto& cell : map) {
26 for (
const Vector& p : cell.second) {
60 template <
typename TAdd>
67 for (
Size i = 0; i < 3; ++i) {
71 if (search.overlaps(cellBox(next))) {
81 if (search.overlaps(cellBox(next))) {
89 for (
int z = left[2]; z <= right[2]; ++z) {
90 for (
int y = left[1]; y <= right[1]; ++y) {
91 for (
int x = left[0]; x <= right[0]; ++x) {
93 const auto iter = map.find(idxs);
94 if (iter == map.end()) {
98 for (
Size i = 0; i < iter->second.size(); ++i) {
99 const Vector& p = iter->second[i];
102 add(Handle(idxs, i, {}));
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE auto floor(const T &f)
#define NAMESPACE_SPH_END
INLINE Float getSqrLength(const Vector &v)
Object providing safe access to continuous memory of data.
Generic dynamically allocated resizable storage.
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
void clear()
Removes all elements from the array, but does NOT release the memory.
INLINE TCounter size() const noexcept
Helper object for storing three (possibly four) int or bool values.
Identifies a point in the point cloud.
Indices coords() const
Grid coordinates.
Size index() const
Index of the point within the cell.
Size getClosePointsCount(const Vector ¢er, const Float radius) const
Returns the number of points within given distance from the center point.
Handle push(const Vector &p)
Adds a point into the cloud.
Size size() const
Returns the number of points in the cloud.
Array< Vector > array() const
Returns all points in the cloud as array.
Vector point(const Handle &handle) const
Returns the point corresponding to given handle.
void findClosePoints(const Vector ¢er, const Float radius, Array< Handle > &handles) const
Returns point within given distance from the center point.