55 pointLabels_(pointLabels),
110 label pointI = (useSubset_ ? pointLabels_[index] : index);
111 return cubeBb.
contains(points_[pointI]);
120 const scalar radiusSqr
123 label pointI = (useSubset_ ? pointLabels_[index] : index);
125 if (
magSqr(points_[pointI] - centre) <= radiusSqr)
134 void Foam::treeDataPoint::findNearestOp::operator()
139 scalar& nearestDistSqr,
148 const label index = indices[i];
158 scalar distSqr =
magSqr(pt - sample);
160 if (distSqr < nearestDistSqr)
162 nearestDistSqr = distSqr;
170 void Foam::treeDataPoint::findNearestOp::operator()
184 scalar nearestDistSqr = GREAT;
187 nearestDistSqr =
magSqr(linePoint - nearestPoint);
192 const label index = indices[i];
202 if (tightest.contains(shapePt))
205 pointHit pHit = ln.nearestDist(shapePt);
208 if (distSqr < nearestDistSqr)
210 nearestDistSqr = distSqr;
213 nearestPoint = shapePt;
217 minPt =
min(ln.start(), ln.end());
224 maxPt =
max(ln.start(), ln.end());
235 bool Foam::treeDataPoint::findIntersectOp::operator()
245 "treeDataPoint::intersects(const label, const point&," 246 "const point&, point&)" const Point & rawPoint() const
Return point with no checking.
volumeType getVolumeType(const indexedOctree< treeDataPoint > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
const labelList & pointLabels() const
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
findIntersectOp(const indexedOctree< treeDataPoint > &tree)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Standard boundBox + extra functionality for use in octree.
vectorField pointField
pointField is a vectorField.
const pointField & points() const
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
pointField shapePoints() const
Get representative point cloud for all shapes inside.
treeDataPoint(const pointField &)
Construct from pointField. Holds reference!
Non-pointer based hierarchical recursive searching.
scalar distance() const
Return distance to hit.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
findNearestOp(const indexedOctree< treeDataPoint > &tree)
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.
defineTypeNameAndDebug(combustionModel, 0)