40 void Foam::treeDataCell::update()
44 bbs_.setSize(cellLabels_.size());
51 mesh_.cells()[cellLabels_[i]].bb
73 cellLabels_(cellLabels),
75 decompMode_(decompMode)
90 cellLabels_(move(cellLabels)),
92 decompMode_(decompMode)
106 cellLabels_(
identity(mesh_.nCells())),
108 decompMode_(decompMode)
140 cc[i] = mesh_.cellCentres()[cellLabels_[i]];
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();
bool overlaps(const boundBox &) const
Overlaps/touches boundingBox?
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
#define forAll(list, i)
Loop across all elements in list.
A face is a list of labels corresponding to mesh vertices.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
pointHit ray(const point &p, const vector &n, const pointField &, const intersection::algorithm alg=intersection::algorithm::fullRay, const intersection::direction dir=intersection::direction::vector) const
Return potential intersection with face with a ray starting.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
const cellList & cells() const
direction posBits(const point &) const
Position of point relative to bounding box.
cellDecomposition
Enumeration defining the decomposition of the cell for.
virtual const pointField & points() const
Return raw points.
static scalar setPlanarTol(const scalar t)
Set the planar tolerance, returning the previous value.
const polyMesh & mesh() const
findIntersectOp(const indexedOctree< treeDataCell > &tree)
const Point & hitPoint() const
Return hit point.
bool hit() const
Is there a hit.
virtual const faceList & faces() const
Return raw faces.
const vectorField & cellCentres() const
treeDataCell(const bool cacheBb, const polyMesh &, const labelUList &, const polyMesh::cellDecomposition decompMode)
Construct from mesh and subset of cells.
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)
Encapsulation of data needed to search in/for cells. Used to find the cell containing a point (e...
pointField shapePoints() const
Get representative point cloud for all shapes inside.
findNearestOp(const indexedOctree< treeDataCell > &tree)
Non-pointer based hierarchical recursive searching.
A cell is defined as a list of faces with extra functionality.
Standard boundBox + extra functionality for use in octree.
Mesh consisting of general polyhedral cells.
scalar distance() const
Return distance to hit.
const labelList & cellLabels() const
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
bool contains(const label index, const point &sample) const
Does shape at index contain sample.