37#ifndef Foam_treeDataPrimitivePatch_H
38#define Foam_treeDataPrimitivePatch_H
63template<
class PatchType>
66 public treeDataPrimitivePatchName
71 const PatchType& patch_;
77 const scalar planarTol_;
86 inline treeBoundBox getBounds(
const label patchFacei)
const;
108 scalar& nearestDistSqr,
143 point& intersectionPoint
169 point& intersectionPoint
195 point& intersectionPoint
207 const PatchType&
patch,
208 const scalar planarTol
248 bool empty()
const {
return !patch_.size(); }
251 label
size()
const {
return patch_.size(); }
254 label
objectIndex(
const label index)
const noexcept {
return index; }
263 return patch_.faceCentres()[index];
270 return patch_.faceCentres();
296 const scalar radiusSqr
306 point& intersectionPoint
316 scalar& nearestDistSqr,
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Minimal example by using system/controlDict.functions:
Non-pointer based hierarchical recursive searching.
A class for managing temporary objects.
Standard boundBox with extra functionality for use in octree.
findAllIntersectOp(const indexedOctree< treeDataPrimitivePatch > &tree, DynamicList< label > &shapeMask)
findIntersectOp(const indexedOctree< treeDataPrimitivePatch > &tree)
findNearestOp(const indexedOctree< treeDataPrimitivePatch > &tree)
findSelfIntersectOp(const indexedOctree< treeDataPrimitivePatch > &tree, const label edgeID)
Encapsulation of data needed to search on PrimitivePatches.
bool useSubset() const noexcept
const labelList& faceLabels() const noexcept { labelList::null(); }
volumeType getVolumeType(const indexedOctree< treeDataPrimitivePatch< PatchType > > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
static bool findIntersection(const indexedOctree< treeDataPrimitivePatch< PatchType > > &tree, const label index, const point &start, const point &end, point &intersectionPoint)
Helper: find intersection of line with shapes.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
int nDim() const noexcept
Object dimension == 2 (face element).
treeDataPrimitivePatch(const bool cacheBb, const PatchType &patch, const scalar planarTol)
Construct from patch.
bool overlaps(const label index, const point ¢re, const scalar radiusSqr) const
Does shape at index overlap sphere.
bool empty() const
Is the patch empty (no faces)?
treeDataPrimitivePatch(const PatchType &patch, const scalar planarTol)
Construct from patch.
treeBoundBox bounds(const labelUList &indices) const
Return bounding box for the specified face indices.
const point & centre(const label index) const
Representative point (face centre) at shape index.
const primitivePatch & patch() const noexcept
static treeBoundBoxList boxes(const PatchType &patch)
Calculate and return bounding boxes for each patch face.
label size() const
The patch size.
tmp< pointField > centres() const
Representative point cloud for contained shapes. One point per shape, corresponding to the face centr...
label objectIndex(const label index) const noexcept
Map from shape index to original (non-subset) face label.
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does shape at index overlap searchBox.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
#define TemplateName(TemplateNameString)
Add typeName information from argument TypeNameString to a.
Namespace for bounding specifications. At the moment, mostly for tables.
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())