39#ifndef Foam_treeDataCell_H
40#define Foam_treeDataCell_H
69 const bool useSubset_;
105 scalar& nearestDistSqr,
136 point& intersectionPoint
261 return useSubset_ ? cellLabels_.empty() : !mesh_.nCells();
267 return useSubset_ ? cellLabels_.size() : mesh_.nCells();
273 return useSubset_ && index >= 0 ? cellLabels_[index] : index;
326 scalar& nearestDistSqr,
Minimal example by using system/controlDict.functions:
Non-pointer based hierarchical recursive searching.
Mesh consisting of general polyhedral cells.
cellDecomposition
Enumeration defining the decomposition of the cell for.
Cell-face mesh analysis engine.
A class for managing temporary objects.
Standard boundBox with extra functionality for use in octree.
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 useSubset() const noexcept
Use a subset of cells.
tmp< pointField > centres() const
Representative point cloud for contained shapes. One point per shape, corresponding to the cell centr...
const labelList & cellLabels() const noexcept
The subset of cell ids to use.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
bool empty() const noexcept
Is the effective cell selection empty?
int nDim() const noexcept
Object dimension == 3 (volume element).
bool contains(const label index, const point &sample) const
Does shape at index contain sample.
const point & centre(const label index) const
Representative point (cell centre) at shape index.
label objectIndex(const label index) const
Map from shape index to original (non-subset) cell label.
volumeType getVolumeType(const indexedOctree< treeDataCell > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
treeDataCell(const polyMesh &mesh, polyMesh::cellDecomposition decompMode)
Construct from mesh, using all cells in mesh.
ClassNameNoDebug("treeDataCell")
label size() const noexcept
The size of the cell selection.
treeDataCell(const polyMesh &mesh, const labelUList &cellLabels, polyMesh::cellDecomposition decompMode)
Construct from mesh, copying subset of cells.
static treeBoundBox bounds(const primitiveMesh &mesh, const labelUList &cellIds)
Return bounding box of specified mesh cells.
static treeBoundBoxList boxes(const primitiveMesh &mesh)
Calculate and return bounding boxes for all mesh cells.
const polyMesh & mesh() const noexcept
Reference to the supporting mesh.
treeDataCell(const polyMesh &mesh, labelList &&cellLabels, polyMesh::cellDecomposition decompMode)
Construct from mesh, moving subset of cells.
polyMesh::cellDecomposition decompMode() const noexcept
The cell decomposition mode used.
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does (bb of) shape at index overlap searchBox.
treeDataCell(const bool cacheBb, const polyMesh &mesh, polyMesh::cellDecomposition decompMode)
Construct from mesh, using all cells in mesh.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
#define ClassNameNoDebug(TypeNameString)
Add typeName information from argument TypeNameString to a class.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Namespace for bounding specifications. At the moment, mostly for tables.
List< label > labelList
A List of labels.
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
line< point, const point & > linePointRef
A line using referred points.
vector point
Point is a vector.
UList< label > labelUList
A UList of labels.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
Tree tree(triangles.begin(), triangles.end())