treeDataPrimitivePatch< PatchType > Class Template Reference

Encapsulation of data needed to search on PrimitivePatches. More...

Inheritance diagram for treeDataPrimitivePatch< PatchType >:
Collaboration diagram for treeDataPrimitivePatch< PatchType >:

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 pointcentre (const label index) const
 Representative point (face centre) at shape index. More...
 
tmp< pointFieldcentres () 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 &centre, 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...
 

Detailed Description

template<class PatchType>
class Foam::treeDataPrimitivePatch< PatchType >

Encapsulation of data needed to search on PrimitivePatches.

Source files

Definition at line 59 of file treeDataPrimitivePatch.H.

Constructor & Destructor Documentation

◆ treeDataPrimitivePatch() [1/2]

treeDataPrimitivePatch ( const bool  cacheBb,
const PatchType &  patch,
const scalar  planarTol 
)

Construct from patch.

Definition at line 79 of file treeDataPrimitivePatch.C.

References update().

Here is the call graph for this function:

◆ treeDataPrimitivePatch() [2/2]

treeDataPrimitivePatch ( const PatchType &  patch,
const scalar  planarTol 
)
inline

Construct from patch.

Definition at line 238 of file treeDataPrimitivePatch.H.

Member Function Documentation

◆ boxes()

Foam::treeBoundBoxList boxes ( const PatchType &  patch)
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().

Here is the call graph for this function:

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 2 (face element)

Definition at line 257 of file treeDataPrimitivePatch.H.

◆ bounds()

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().

Here is the call graph for this function:

◆ patch()

const PatchType& patch ( ) const
inlinenoexcept

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

const labelList& faceLabels() const noexcept { labelList::null(); }

Use a subset of the patch

Definition at line 278 of file treeDataPrimitivePatch.H.

◆ empty()

bool empty ( ) const
inline

Is the patch empty (no faces)?

Definition at line 283 of file treeDataPrimitivePatch.H.

◆ size()

label size ( ) const
inline

The patch size.

Definition at line 288 of file treeDataPrimitivePatch.H.

◆ objectIndex()

label objectIndex ( const label  index) const
inlinenoexcept

Map from shape index to original (non-subset) face label.

Definition at line 293 of file treeDataPrimitivePatch.H.

◆ centre()

const point& centre ( const label  index) const
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.

◆ centres()

tmp<pointField> centres ( ) const
inline

Representative point cloud for contained shapes. One point per shape, corresponding to the face centres.

Definition at line 311 of file treeDataPrimitivePatch.H.

◆ getVolumeType() [1/3]

Foam::volumeType getVolumeType ( const indexedOctree< treeDataPrimitivePatch< PatchType >> &  oc,
const point sample 
) const

◆ overlaps() [1/2]

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.

Here is the call graph for this function:

◆ overlaps() [2/2]

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().

Here is the call graph for this function:

◆ findIntersection()

bool findIntersection ( const indexedOctree< treeDataPrimitivePatch< PatchType >> &  tree,
const label  index,
const point start,
const point end,
point intersectionPoint 
)
static

◆ findNearest()

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()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVolumeType() [2/3]

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().

Here is the call graph for this function:

◆ getVolumeType() [3/3]

volumeType getVolumeType ( const indexedOctree< treeDataPrimitivePatch< triSurface >> &  oc,
const point sample 
) const

Template specialisation of getVolumeType for treeDataTriSurface.


The documentation for this class was generated from the following files: