55 pointLabels_(pointLabels),
107 label pointi = (useSubset_ ? pointLabels_[index] : index);
108 return cubeBb.
contains(points_[pointi]);
116 const scalar radiusSqr
119 label pointi = (useSubset_ ? pointLabels_[index] : index);
121 if (
magSqr(points_[pointi] - centre) <= radiusSqr)
130 void Foam::treeDataPoint::findNearestOp::operator()
135 scalar& nearestDistSqr,
144 const label index = indices[i];
154 scalar distSqr =
magSqr(pt - sample);
156 if (distSqr < nearestDistSqr)
158 nearestDistSqr = distSqr;
166 void Foam::treeDataPoint::findNearestOp::operator()
180 scalar nearestDistSqr = great;
183 nearestDistSqr =
magSqr(linePoint - nearestPoint);
188 const label index = indices[i];
198 if (tightest.contains(shapePt))
201 pointHit pHit = ln.nearestDist(shapePt);
204 if (distSqr < nearestDistSqr)
206 nearestDistSqr = distSqr;
209 nearestPoint = shapePt;
213 minPt =
min(ln.start(), ln.end());
220 maxPt =
max(ln.start(), ln.end());
231 bool Foam::treeDataPoint::findIntersectOp::operator()
volumeType getVolumeType(const indexedOctree< treeDataPoint > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
vectorField pointField
pointField is a vectorField.
findNearestOp(const indexedOctree< treeDataPoint > &tree)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const Point & rawPoint() const
Return point with no checking.
defineTypeNameAndDebug(combustionModel, 0)
findIntersectOp(const indexedOctree< treeDataPoint > &tree)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Non-pointer based hierarchical recursive searching.
const pointField & points() const
const labelList & pointLabels() const
Standard boundBox + extra functionality for use in octree.
treeDataPoint(const pointField &)
Construct from pointField. Holds reference!
pointField shapePoints() const
Get representative point cloud for all shapes inside.
scalar distance() const
Return distance to hit.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.