Loading...
Searching...
No Matches
treeDataPrimitivePatch< PatchType > Class Template Reference

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

#include <treeDataPrimitivePatch.H>

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

Classes

class  findNearestOp
class  findIntersectOp
class  findAllIntersectOp
class  findSelfIntersectOp

Public Member Functions

 treeDataPrimitivePatch (const bool cacheBb, const PatchType &patch, const scalar planarTol)
 Construct from patch.
 treeDataPrimitivePatch (const PatchType &patch, const scalar planarTol)
 Construct from patch.
int nDim () const noexcept
 Object dimension == 2 (face element).
treeBoundBox bounds (const labelUList &indices) const
 Return bounding box for the specified face indices.
const PatchType & patch () const noexcept
 The underlying patch.
bool useSubset () const noexcept
 const labelList& faceLabels() const noexcept { labelList::null(); }
bool empty () const
 Is the patch empty (no faces)?
label size () const
 The patch size.
label objectIndex (const label index) const noexcept
 Map from shape index to original (non-subset) face label.
const pointcentre (const label index) const
 Representative point (face centre) at shape index.
tmp< pointFieldcentres () const
 Representative point cloud for contained shapes. One point per shape, corresponding to the face centres.
volumeType getVolumeType (const indexedOctree< treeDataPrimitivePatch< PatchType > > &, const point &) const
 Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
bool overlaps (const label index, const treeBoundBox &searchBox) const
 Does shape at index overlap searchBox.
bool overlaps (const label index, const point &centre, const scalar radiusSqr) const
 Does shape at index overlap sphere.
void findNearest (const labelUList &indices, const point &sample, scalar &nearestDistSqr, label &nearestIndex, point &nearestPoint) const
 Calculates nearest (to sample) point in shape.
Foam::volumeType getVolumeType (const indexedOctree< treeDataPrimitivePatch< triSurface > > &oc, const point &sample) const
volumeType getVolumeType (const indexedOctree< treeDataPrimitivePatch< triSurface > > &oc, const point &sample) const
 Template specialisation of getVolumeType for treeDataTriSurface.

Static Public Member Functions

static treeBoundBoxList boxes (const PatchType &patch)
 Calculate and return bounding boxes for each patch face.
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.

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]

template<class PatchType>
treeDataPrimitivePatch ( const bool cacheBb,
const PatchType & patch,
const scalar planarTol )

◆ treeDataPrimitivePatch() [2/2]

template<class PatchType>
treeDataPrimitivePatch ( const PatchType & patch,
const scalar planarTol )
inline

Construct from patch.

Definition at line 238 of file treeDataPrimitivePatch.H.

Member Function Documentation

◆ boxes()

template<class PatchType>
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()

template<class PatchType>
int nDim ( ) const
inlinenoexcept

Object dimension == 2 (face element).

Definition at line 257 of file treeDataPrimitivePatch.H.

◆ bounds()

template<class PatchType>
Foam::treeBoundBox bounds ( const labelUList & indices) const

Return bounding box for the specified face indices.

Definition at line 142 of file treeDataPrimitivePatch.C.

◆ patch()

template<class PatchType>
const PatchType & patch ( ) const
inlinenoexcept

◆ useSubset()

template<class PatchType>
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()

template<class PatchType>
bool empty ( ) const
inline

Is the patch empty (no faces)?

Definition at line 283 of file treeDataPrimitivePatch.H.

◆ size()

template<class PatchType>
label size ( ) const
inline

The patch size.

Definition at line 288 of file treeDataPrimitivePatch.H.

◆ objectIndex()

template<class PatchType>
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()

template<class PatchType>
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.

Referenced by overlaps().

Here is the caller graph for this function:

◆ centres()

template<class PatchType>
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]

template<class PatchType>
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 159 of file treeDataPrimitivePatch.C.

References treeDataPrimitivePatch().

Here is the call graph for this function:

◆ overlaps() [1/2]

template<class PatchType>
bool overlaps ( const label index,
const treeBoundBox & searchBox ) const

Does shape at index overlap searchBox.

Definition at line 388 of file treeDataPrimitivePatch.C.

References boundBox::containsAny(), f(), forAll, treeBoundBox::intersects(), treeBoundBox::overlaps(), and points.

Referenced by overlaps().

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

◆ overlaps() [2/2]

template<class PatchType>
bool overlaps ( const label index,
const point & centre,
const scalar radiusSqr ) const

Does shape at index overlap sphere.

Definition at line 447 of file treeDataPrimitivePatch.C.

References centre(), PointHit< PointType >::distance(), f(), overlaps(), points, and Foam::sqr().

Here is the call graph for this function:

◆ findIntersection()

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

◆ findNearest()

template<class PatchType>
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 484 of file treeDataPrimitivePatch.C.

References PointHit< PointType >::distance(), f(), PointHit< PointType >::point(), points, and Foam::sqr().

Here is the call graph for this function:

◆ getVolumeType() [2/3]

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

Definition at line 28 of file treeDataTriSurface.C.

◆ 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: