42 const cellList& cells = mesh_.cells();
43 const faceList& faces = mesh_.faces();
48 vector(great, great, great),
49 vector(-great, -great, -great)
52 const cell& cFaces = cells[celli];
56 const face& f = faces[cFaces[cFacei]];
60 const point& p = points[f[fp]];
62 cellBb.
min() =
min(cellBb.min(),
p);
63 cellBb.max() =
max(cellBb.max(),
p);
70 void Foam::treeDataCell::update()
74 bbs_.setSize(cellLabels_.size());
78 bbs_[i] = calcCellBb(cellLabels_[i]);
95 cellLabels_(cellLabels),
97 decompMode_(decompMode)
112 cellLabels_(move(cellLabels)),
114 decompMode_(decompMode)
128 cellLabels_(
identity(mesh_.nCells())),
130 decompMode_(decompMode)
162 cc[i] = mesh_.cellCentres()[cellLabels_[i]];
177 return cubeBb.
overlaps(bbs_[index]);
181 return cubeBb.
overlaps(calcCellBb(cellLabels_[index]));
192 return mesh_.pointInCell(sample, cellLabels_[index], decompMode_);
196 void Foam::treeDataCell::findNearestOp::operator()
201 scalar& nearestDistSqr,
210 label index = indices[i];
214 if (distSqr < nearestDistSqr)
216 nearestDistSqr = distSqr;
224 void Foam::treeDataCell::findNearestOp::operator()
239 bool Foam::treeDataCell::findIntersectOp::operator()
244 point& intersectionPoint
262 const treeBoundBox cellBb = shape.calcCellBb(shape.cellLabels_[index]);
278 const cell& cFaces = shape.mesh_.
cells()[shape.cellLabels_[index]];
280 const vector dir(end - start);
281 scalar minDistSqr =
magSqr(dir);
286 const face& f = shape.mesh_.
faces()[cFaces[i]];
302 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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
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
Vector< scalar > vector
A scalar version of the templated Vector.
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)
vectorField pointField
pointField is a vectorField.
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...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
pointField shapePoints() const
Get representative point cloud for all shapes inside.
findNearestOp(const indexedOctree< treeDataCell > &tree)
vector point
Point is a vector.
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.
List< cell > cellList
list of cells
bool contains(const label index, const point &sample) const
Does shape at index contain sample.