Encapsulation of data needed to search on PrimitivePatches. More...
Classes | |
class | findAllIntersectOp |
class | findIntersectOp |
class | findNearestOp |
class | findSelfIntersectOp |
Public Member Functions | |
treeDataPrimitivePatch (const bool cacheBb, const PatchType &patch, const scalar planarTol) | |
Construct from patch. More... | |
treeDataPrimitivePatch (const PatchType &patch, const scalar planarTol) | |
Construct from patch. More... | |
int | nDim () const noexcept |
Object dimension == 2 (face element) More... | |
treeBoundBox | bounds (const labelUList &indices) const |
Return bounding box for the specified face indices. More... | |
const PatchType & | patch () const noexcept |
The underlying patch. More... | |
bool | useSubset () const noexcept |
const labelList& faceLabels() const noexcept { labelList::null(); } More... | |
bool | empty () const |
Is the patch empty (no faces)? More... | |
label | size () const |
The patch size. More... | |
label | objectIndex (const label index) const noexcept |
Map from shape index to original (non-subset) face label. More... | |
const point & | centre (const label index) const |
Representative point (face centre) at shape index. More... | |
tmp< pointField > | centres () const |
Representative point cloud for contained shapes. One point per shape, corresponding to the face centres. More... | |
volumeType | getVolumeType (const indexedOctree< treeDataPrimitivePatch< PatchType >> &, const point &) const |
Get type (inside,outside,mixed,unknown) of point w.r.t. surface. More... | |
bool | overlaps (const label index, const treeBoundBox &searchBox) const |
Does shape at index overlap searchBox. More... | |
bool | overlaps (const label index, const point ¢re, const scalar radiusSqr) const |
Does shape at index overlap sphere. More... | |
void | findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const |
Calculates nearest (to sample) point in shape. More... | |
template<> | |
Foam::volumeType | getVolumeType (const indexedOctree< treeDataPrimitivePatch< triSurface >> &oc, const point &sample) const |
template<> | |
volumeType | getVolumeType (const indexedOctree< treeDataPrimitivePatch< triSurface >> &oc, const point &sample) const |
Template specialisation of getVolumeType for treeDataTriSurface. More... | |
Static Public Member Functions | |
static treeBoundBoxList | boxes (const PatchType &patch) |
Calculate and return bounding boxes for each patch face. More... | |
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. More... | |
Encapsulation of data needed to search on PrimitivePatches.
Definition at line 59 of file treeDataPrimitivePatch.H.
treeDataPrimitivePatch | ( | const bool | cacheBb, |
const PatchType & | patch, | ||
const scalar | planarTol | ||
) |
Construct from patch.
Definition at line 79 of file treeDataPrimitivePatch.C.
References update().
|
inline |
Construct from patch.
Definition at line 238 of file treeDataPrimitivePatch.H.
|
static |
Calculate and return bounding boxes for each patch face.
Definition at line 32 of file treeDataPrimitivePatch.C.
References UList< T >::begin(), f(), points, and pp().
|
inlinenoexcept |
Object dimension == 2 (face element)
Definition at line 257 of file treeDataPrimitivePatch.H.
Foam::treeBoundBox bounds | ( | const labelUList & | indices | ) | const |
Return bounding box for the specified face indices.
Definition at line 143 of file treeDataPrimitivePatch.C.
References boundBox::add().
|
inlinenoexcept |
The underlying patch.
Definition at line 270 of file treeDataPrimitivePatch.H.
Referenced by treeDataPrimitivePatch< PatchType >::findIntersection(), findNearestMaskedOp< PatchType >::operator()(), and treeDataPrimitivePatch< PatchType >::findSelfIntersectOp::operator()().
|
inlinenoexcept |
const labelList& faceLabels() const noexcept { labelList::null(); }
Use a subset of the patch
Definition at line 278 of file treeDataPrimitivePatch.H.
|
inline |
Is the patch empty (no faces)?
Definition at line 283 of file treeDataPrimitivePatch.H.
|
inline |
The patch size.
Definition at line 288 of file treeDataPrimitivePatch.H.
|
inlinenoexcept |
Map from shape index to original (non-subset) face label.
Definition at line 293 of file treeDataPrimitivePatch.H.
|
inline |
Representative point (face centre) at shape index.
const typename PatchType::face_type& operator[](label index) const { return patch_[index]; }
Definition at line 302 of file treeDataPrimitivePatch.H.
|
inline |
Representative point cloud for contained shapes. One point per shape, corresponding to the face centres.
Definition at line 311 of file treeDataPrimitivePatch.H.
Foam::volumeType getVolumeType | ( | const indexedOctree< treeDataPrimitivePatch< PatchType >> & | oc, |
const point & | sample | ||
) | const |
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
Only makes sense for closed surfaces.
Definition at line 160 of file treeDataPrimitivePatch.C.
References Foam::abort(), Foam::fieldTypes::area, Foam::ensightOutput::debug, Foam::constant::electromagnetic::e, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, PointHit< PointType >::hit(), PointIndexHit< PointType >::index(), Foam::mag(), Foam::magSqr(), Foam::normalised(), PointHit< PointType >::point(), points, Foam::Pout, Foam::sqr(), and Foam::Zero.
bool overlaps | ( | const label | index, |
const treeBoundBox & | searchBox | ||
) | const |
Does shape at index overlap searchBox.
Definition at line 389 of file treeDataPrimitivePatch.C.
References boundBox::containsAny(), f(), forAll, treeBoundBox::intersects(), treeBoundBox::overlaps(), and points.
bool overlaps | ( | const label | index, |
const point & | centre, | ||
const scalar | radiusSqr | ||
) | const |
Does shape at index overlap sphere.
Definition at line 448 of file treeDataPrimitivePatch.C.
References PointHit< PointType >::distance(), f(), points, and Foam::sqr().
|
static |
Helper: find intersection of line with shapes.
Definition at line 616 of file treeDataPrimitivePatch.C.
References PointHit< PointType >::distance(), stdFoam::end(), f(), PointHit< PointType >::hit(), Foam::foamVersion::patch, treeDataPrimitivePatch< PatchType >::patch(), PointHit< PointType >::point(), points, treeBoundBox::posBits(), and tree().
void findNearest | ( | const labelUList & | indices, |
const point & | sample, | ||
scalar & | nearestDistSqr, | ||
label & | nearestIndex, | ||
point & | nearestPoint | ||
) | const |
Calculates nearest (to sample) point in shape.
Returns actual point and distance (squared)
Definition at line 485 of file treeDataPrimitivePatch.C.
References PointHit< PointType >::distance(), f(), PointHit< PointType >::point(), points, and Foam::sqr().
Referenced by treeDataPrimitivePatch< PatchType >::findNearestOp::operator()().
Foam::volumeType getVolumeType | ( | const indexedOctree< treeDataPrimitivePatch< triSurface >> & | oc, |
const point & | sample | ||
) | const |
Definition at line 29 of file treeDataTriSurface.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, PointIndexHit< PointType >::index(), and Foam::sqr().
volumeType getVolumeType | ( | const indexedOctree< treeDataPrimitivePatch< triSurface >> & | oc, |
const point & | sample | ||
) | const |
Template specialisation of getVolumeType for treeDataTriSurface.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.