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,
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;
179void Foam::treeDataPoint::findNearestOp::operator()
184 scalar& nearestDistSqr,
189 tree_.shapes().findNearest
200void 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();
247bool Foam::treeDataPoint::findIntersectOp::operator()
Minimal example by using system/controlDict.functions:
scalar distance() const noexcept
Return distance to hit.
const point_type & point() const noexcept
Return the point, no checks.
void grow(const scalar delta)
Expand box by adjusting min/max by specified amount in each dimension.
void add(const boundBox &bb)
Extend to include the second box.
Non-pointer based hierarchical recursive searching.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Standard boundBox with extra functionality for use in octree.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
findIntersectOp(const indexedOctree< treeDataPoint > &tree)
findNearestOp(const indexedOctree< treeDataPoint > &tree)
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
tmp< pointField > centres() const
Point cloud.
treeDataPoint(const pointField &points)
Construct from pointField.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
treeBoundBox bounds(const labelUList &indices) const
Return bounding box for the specified point indices.
const point & centre(const label index) const
Point at specified shape index.
const pointField & points() const noexcept
The original point field.
volumeType getVolumeType(const indexedOctree< treeDataPoint > &os, const point &sample) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does (bb of) shape at index searchBox.
const labelList & pointLabels() const noexcept
The subset of point ids to use.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
#define defineTypeName(Type)
Define the typeName.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
PointHit< point > pointHit
A PointHit with a 3D point.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
line< point, const point & > linePointRef
A line using referred points.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
labelList pointLabels(nPoints, -1)
Tree tree(triangles.begin(), triangles.end())