53 const bool useSubsetPoints
58 useSubset_(useSubsetPoints)
66 const bool useSubsetPoints
71 useSubset_(useSubsetPoints)
82 for (
const label index : indices)
84 bb.
add(points_[pointLabels_[index]]);
106 const indexedOctree<treeDataPoint>& oc,
120 return searchBox.
contains(centre(index));
128 const scalar radiusSqr
131 return (centre.distSqr(this->centre(index)) <= radiusSqr);
158 scalar& nearestDistSqr,
163 for (
const label index : indices)
167 const scalar distSqr = sample.distSqr(pt);
169 if (distSqr < nearestDistSqr)
171 nearestDistSqr = distSqr;
179 void Foam::treeDataPoint::findNearestOp::operator()
184 scalar& nearestDistSqr,
189 tree_.shapes().findNearest
200 void Foam::treeDataPoint::findNearestOp::operator()
216 scalar nearestDistSqr = GREAT;
219 nearestDistSqr = linePoint.distSqr(nearestPoint);
222 for (
const label index : indices)
226 if (tightest.contains(pt))
232 if (distSqr < nearestDistSqr)
234 nearestDistSqr = distSqr;
236 linePoint = pHit.
point();
247 bool Foam::treeDataPoint::findIntersectOp::operator()
Holds (reference to) pointField. Encapsulation of data needed for octree searches. Used for searching for nearest point. No bounding boxes around points. Only overlaps and calcNearest are implemented, rest makes little sense.
labelList pointLabels(nPoints, -1)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does (bb of) shape at index searchBox.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
UList< label > labelUList
A UList of labels.
const point & centre(const label index) const
Point at specified shape index.
tmp< pointField > centres() const
Point cloud.
defineTypeName(manifoldCellsMeshObject)
void add(const boundBox &bb)
Extend to include the second box.
findNearestOp(const indexedOctree< treeDataPoint > &tree)
treeDataPoint(const pointField &points)
Construct from pointField.
Tree tree(triangles.begin(), triangles.end())
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
findIntersectOp(const indexedOctree< treeDataPoint > &tree)
treeBoundBox bounds(const labelUList &indices) const
Return bounding box for the specified point indices.
volumeType getVolumeType(const indexedOctree< treeDataPoint > &os, const point &sample) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
vector point
Point is a vector.
Non-pointer based hierarchical recursive searching.
scalar distance() const noexcept
Return distance to hit.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
const point_type & point() const noexcept
Return the point, no checks.
Standard boundBox with extra functionality for use in octree.
A class for managing temporary objects.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.