37 #ifndef Foam_treeDataPrimitivePatch_H 38 #define Foam_treeDataPrimitivePatch_H 63 template<
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(); }
263 return patch_.faceCentres()[index];
268 tmp<pointField>
centres()
const 270 return patch_.faceCentres();
296 const scalar radiusSqr
306 point& intersectionPoint
316 scalar& nearestDistSqr,
TemplateName(blendedSchemeBase)
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.
bool overlaps(const label index, const treeBoundBox &searchBox) const
Does shape at index overlap searchBox.
const point & centre(const label index) const
Representative point (face centre) at shape index.
const PatchType & patch() const noexcept
The underlying patch.
volumeType getVolumeType(const indexedOctree< treeDataPrimitivePatch< PatchType >> &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
label size() const
The patch size.
void findNearest(const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
Calculates nearest (to sample) point in shape.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
UList< label > labelUList
A UList of labels.
findNearestOp(const indexedOctree< treeDataPrimitivePatch > &tree)
Encapsulation of data needed to search on PrimitivePatches.
treeBoundBox bounds(const labelUList &indices) const
Return bounding box for the specified face indices.
Tree tree(triangles.begin(), triangles.end())
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
findSelfIntersectOp(const indexedOctree< treeDataPrimitivePatch > &tree, const label edgeID)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
static treeBoundBoxList boxes(const PatchType &patch)
Calculate and return bounding boxes for each patch face.
vector point
Point is a vector.
bool useSubset() const noexcept
const labelList& faceLabels() const noexcept { labelList::null(); }
Non-pointer based hierarchical recursive searching.
findAllIntersectOp(const indexedOctree< treeDataPrimitivePatch > &tree, DynamicList< label > &shapeMask)
Standard boundBox with extra functionality for use in octree.
int nDim() const noexcept
Object dimension == 2 (face element)
label objectIndex(const label index) const noexcept
Map from shape index to original (non-subset) face label.
treeDataPrimitivePatch(const bool cacheBb, const PatchType &patch, const scalar planarTol)
Construct from patch.
tmp< pointField > centres() const
Representative point cloud for contained shapes. One point per shape, corresponding to the face centr...
findIntersectOp(const indexedOctree< treeDataPrimitivePatch > &tree)
bool empty() const
Is the patch empty (no faces)?