76 return searchBox.
contains(centre(index));
84 const scalar radiusSqr
87 return (centre.distSqr(this->centre(index)) <= radiusSqr);
96 scalar& nearestDistSqr,
101 for (
const label index : indices)
103 const point& pt = centre(index);
105 const scalar distSqr = sample.distSqr(pt);
107 if (distSqr < nearestDistSqr)
109 nearestDistSqr = distSqr;
122 treeBoundBox& tightest,
128 const treeBoundBox lnBb(
ln.box());
131 scalar nearestDistSqr = linePoint.distSqr(nearestPoint);
133 for (
const label index : indices)
135 const point& pt = centre(index);
137 if (tightest.contains(pt))
141 const scalar distSqr =
sqr(pHit.distance());
143 if (distSqr < nearestDistSqr)
145 nearestDistSqr = distSqr;
147 linePoint = pHit.point();
151 tightest.grow(pHit.distance());
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An enumeration wrapper for classification of a location as being inside/outside of a volume...
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does (bb of) shape at index overlap bb.
volumeType getVolumeType(const dynamicIndexedOctree< dynamicTreeDataPoint > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
UList< label > labelUList
A UList of labels.
dynamicTreeDataPoint(const DynamicList< point > &points)
Construct from List. Holds reference!
defineTypeName(manifoldCellsMeshObject)
line< point, const point & > linePointRef
A line using referred points.
Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted...
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
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...
treeBoundBox bounds(const labelUList &indices) const
Return bounding box for the specified point indices.
vector point
Point is a vector.
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.
Standard boundBox with extra functionality for use in octree.
PointHit< point > pointHit
A PointHit with a 3D point.