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()
#define forAll(list, i)
Loop across all elements in list.
pointField shapePoints() const
Get representative point cloud for all shapes inside.
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.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const Point & rawPoint() const
Return point with no checking.
scalar distance() const
Return distance to hit.
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.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
findIntersectOp(const indexedOctree< treeDataPoint > &tree)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
Non-pointer based hierarchical recursive searching.
Standard boundBox + extra functionality for use in octree.
treeDataPoint(const pointField &)
Construct from pointField. Holds reference!
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
const pointField & points() const
volumeType getVolumeType(const indexedOctree< treeDataPoint > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
const labelList & pointLabels() const