40 void Foam::treeDataCell::update()
51 mesh_.
cells()[cellLabels_[i]].bb
73 cellLabels_(cellLabels),
75 decompMode_(decompMode)
90 cellLabels_(move(cellLabels)),
92 decompMode_(decompMode)
108 decompMode_(decompMode)
155 return cubeBb.
overlaps(bbs_[index]);
161 mesh_.
cells()[cellLabels_[index]].bb
177 return mesh_.
pointInCell(sample, cellLabels_[index], decompMode_);
181 void Foam::treeDataCell::findNearestOp::operator()
186 scalar& nearestDistSqr,
195 label index = indices[i];
199 if (distSqr < nearestDistSqr)
201 nearestDistSqr = distSqr;
209 void Foam::treeDataCell::findNearestOp::operator()
224 bool Foam::treeDataCell::findIntersectOp::operator()
229 point& intersectionPoint
249 shape.mesh_.
cells()[shape.cellLabels_[index]].bb
270 const cell& cFaces = shape.mesh_.
cells()[shape.cellLabels_[index]];
272 const vector dir(end - start);
273 scalar minDistSqr =
magSqr(dir);
278 const face&
f = shape.mesh_.
faces()[cFaces[i]];
294 intersectionPoint = inter.
hitPoint();
#define forAll(list, i)
Loop across all elements in list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
const Point & hitPoint() const
Return hit point.
scalar distance() const
Return distance to hit.
bool hit() const
Is there a hit.
A cell is defined as a list of faces with extra functionality.
A face is a list of labels corresponding to mesh vertices.
Non-pointer based hierarchical recursive searching.
static scalar setPlanarTol(const scalar t)
Set the planar tolerance, returning the previous value.
Mesh consisting of general polyhedral cells.
cellDecomposition
Enumeration defining the decomposition of the cell for.
virtual const faceList & faces() const
Return raw faces.
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
virtual const pointField & points() const
Return raw points.
const vectorField & cellCentres() const
const cellList & cells() const
Standard boundBox + extra functionality for use in octree.
bool overlaps(const boundBox &) const
Overlaps other bounding box?
direction posBits(const point &) const
Position of point relative to bounding box.
findIntersectOp(const indexedOctree< treeDataCell > &tree)
findNearestOp(const indexedOctree< treeDataCell > &tree)
Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e....
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
treeDataCell(const bool cacheBb, const polyMesh &, const labelUList &, const polyMesh::cellDecomposition decompMode)
Construct from mesh and subset of cells.
bool contains(const label index, const point &sample) const
Does shape at index contain sample.
const labelList & cellLabels() const
const polyMesh & mesh() const
pointField shapePoints() const
Get representative point cloud for all shapes inside.
#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)
defineTypeNameAndDebug(combustionModel, 0)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
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.