8 template<
class Bounds,
class Po
int,
class OutIter>
9 void near(
const RegularLink<Bounds>& link,
const Point& p,
float r, OutIter out,
10 const Bounds& domain);
12 template<
class Bounds,
class Po
int,
class OutIter>
13 void in(
const RegularLink<Bounds>& link,
const Point& p, OutIter out,
const Bounds& domain);
15 template<
class Po
int,
class Bounds>
16 float distance(
int dim,
const Bounds& bounds,
const Point& p);
18 template<
class Bounds>
20 float distance(
int dim,
const Bounds& bounds1,
const Bounds& bounds2);
22 template<
class Bounds>
23 void wrap_bounds(Bounds& bounds, Direction wrap_dir,
const Bounds& domain,
int dim);
27 template<
class Bounds,
class Po
int,
class OutIter>
39 for (
int n = 0; n < link.size(); n++)
42 neigh_bounds = link.bounds(n);
43 wrap_bounds(neigh_bounds, link.wrap(n), domain, link.dimension());
45 if (
distance(link.dimension(), neigh_bounds, p) <= r)
51 template<
class Po
int,
class Bounds>
57 for (
int i = 0; i < dim; ++i)
63 d = bounds.min[i] - p[i];
64 if (d > diff) diff = d;
65 d = p[i] - bounds.max[i];
66 if (d > diff) diff = d;
73 template<
class Bounds>
76 distance(
int dim,
const Bounds& bounds1,
const Bounds& bounds2)
79 for (
int i = 0; i < dim; ++i)
83 float d1 = bounds1.max[i] - bounds2.min[i];
84 float d2 = bounds2.max[i] - bounds1.min[i];
99 template<
class Bounds,
class Po
int,
class OutIter>
110 for (
int n = 0; n < link.size(); n++)
113 neigh_bounds = link.bounds(n);
114 wrap_bounds(neigh_bounds, link.wrap(n), domain, link.dimension());
116 if (
distance(link.dimension(), neigh_bounds, p) == 0)
124 template<
class Bounds>
127 wrap_bounds(Bounds& bounds, Direction wrap_dir,
const Bounds& domain,
int dim)
129 for (
int i = 0; i < dim; ++i)
131 bounds.min[i] += wrap_dir[i] * (domain.max[i] - domain.min[i]);
132 bounds.max[i] += wrap_dir[i] * (domain.max[i] - domain.min[i]);
float distance(int dim, const Bounds &bounds, const Point &p)
Find the distance between point p and box bounds.
Definition: pick.hpp:54
void in(const RegularLink< Bounds > &link, const Point &p, OutIter out, const Bounds &domain)
Finds the neighbor(s) containing the target point.
Definition: pick.hpp:102
void near(const RegularLink< Bounds > &link, const Point &p, float r, OutIter out, const Bounds &domain)
Finds the neighbors within radius r of a target point.
Definition: pick.hpp:30