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))
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.
scalar distance() const
Return distance to hit.
const Point & rawPoint() const
Return point with no checking.
Non-pointer based hierarchical recursive searching.
Standard boundBox + 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....
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
volumeType getVolumeType(const indexedOctree< treeDataPoint > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
const labelList & pointLabels() const
treeDataPoint(const pointField &)
Construct from pointField. Holds reference!
pointField shapePoints() const
Get representative point cloud for all shapes inside.
const pointField & points() const
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
vectorField pointField
pointField is a vectorField.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
labelList pointLabels(nPoints, -1)