treeDataFace Class Reference

Encapsulation of data for searching on faces. More...

Classes

class  findIntersectOp
 
class  findNearestOp
 

Public Member Functions

 ClassName ("treeDataFace")
 
 treeDataFace (const bool cacheBb, const primitiveMesh &mesh)
 Construct from mesh, using all faces. More...
 
 treeDataFace (const bool cacheBb, const polyPatch &patch)
 Construct from mesh, using polyPatch faces. More...
 
 treeDataFace (const bool cacheBb, const primitiveMesh &mesh, const labelRange &range)
 Construct from mesh, using specified range of faces. More...
 
 treeDataFace (const bool cacheBb, const primitiveMesh &mesh, const labelUList &faceLabels)
 Construct from mesh, copying subset of faces. More...
 
 treeDataFace (const bool cacheBb, const primitiveMesh &mesh, labelList &&faceLabels)
 Construct from mesh, moving subset of faces. More...
 
 treeDataFace (const primitiveMesh &mesh)
 Construct from mesh, using all faces. More...
 
 treeDataFace (const polyPatch &patch)
 Construct from mesh, using polyPatch faces. More...
 
 treeDataFace (const primitiveMesh &mesh, const labelRange &range)
 Construct from mesh, using specified range of faces. More...
 
 treeDataFace (const primitiveMesh &mesh, const labelUList &faceLabels)
 Construct from mesh, copying subset of faces. More...
 
 treeDataFace (const primitiveMesh &mesh, labelList &&faceLabels)
 Construct from mesh, moving subset of faces. 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 primitiveMeshmesh () const noexcept
 Reference to the supporting mesh. More...
 
const labelListfaceLabels () const noexcept
 The subset of face ids to use. More...
 
bool useSubset () const noexcept
 Use a subset of faces. More...
 
bool empty () const noexcept
 Is the effective face selection empty? More...
 
label size () const noexcept
 The size of the face selection. More...
 
label objectIndex (const label index) const
 Map from shape index to original (non-subset) face label. More...
 
const faceoperator[] (const label index) const
 Face at specified shape index. 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< treeDataFace > &, 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 (bb of) 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...
 

Static Public Member Functions

static treeBoundBoxList boxes (const primitiveMesh &mesh)
 Calculate and return bounding boxes for all mesh faces. More...
 
static treeBoundBoxList boxes (const primitiveMesh &mesh, const labelRange &range)
 Calculate and return bounding boxes for specified range of faces. More...
 
static treeBoundBoxList boxes (const primitiveMesh &mesh, const labelUList &faceIds)
 Calculate and return bounding boxes for specified mesh faces. More...
 
static treeBoundBox bounds (const primitiveMesh &mesh, const labelRange &range)
 Return bounding box of specified range of faces. More...
 
static treeBoundBox bounds (const primitiveMesh &mesh, const labelUList &faceIds)
 Return bounding box of specified mesh faces. More...
 

Detailed Description

Encapsulation of data for searching on faces.

Source files

Definition at line 55 of file treeDataFace.H.

Constructor & Destructor Documentation

◆ treeDataFace() [1/10]

treeDataFace ( const bool  cacheBb,
const primitiveMesh mesh 
)

Construct from mesh, using all faces.

Definition at line 177 of file treeDataFace.C.

References update().

Here is the call graph for this function:

◆ treeDataFace() [2/10]

treeDataFace ( const bool  cacheBb,
const polyPatch patch 
)

Construct from mesh, using polyPatch faces.

Definition at line 210 of file treeDataFace.C.

◆ treeDataFace() [3/10]

treeDataFace ( const bool  cacheBb,
const primitiveMesh mesh,
const labelRange range 
)

Construct from mesh, using specified range of faces.

Definition at line 193 of file treeDataFace.C.

References update().

Here is the call graph for this function:

◆ treeDataFace() [4/10]

treeDataFace ( const bool  cacheBb,
const primitiveMesh mesh,
const labelUList faceLabels 
)

Construct from mesh, copying subset of faces.

Definition at line 220 of file treeDataFace.C.

References update().

Here is the call graph for this function:

◆ treeDataFace() [5/10]

treeDataFace ( const bool  cacheBb,
const primitiveMesh mesh,
labelList &&  faceLabels 
)

Construct from mesh, moving subset of faces.

Definition at line 237 of file treeDataFace.C.

References update().

Here is the call graph for this function:

◆ treeDataFace() [6/10]

treeDataFace ( const primitiveMesh mesh)
inlineexplicit

Construct from mesh, using all faces.

Definition at line 228 of file treeDataFace.H.

◆ treeDataFace() [7/10]

treeDataFace ( const polyPatch patch)
inlineexplicit

Construct from mesh, using polyPatch faces.

Definition at line 236 of file treeDataFace.H.

◆ treeDataFace() [8/10]

treeDataFace ( const primitiveMesh mesh,
const labelRange range 
)
inline

Construct from mesh, using specified range of faces.

Definition at line 244 of file treeDataFace.H.

◆ treeDataFace() [9/10]

treeDataFace ( const primitiveMesh mesh,
const labelUList faceLabels 
)
inline

Construct from mesh, copying subset of faces.

Definition at line 252 of file treeDataFace.H.

◆ treeDataFace() [10/10]

treeDataFace ( const primitiveMesh mesh,
labelList &&  faceLabels 
)
inline

Construct from mesh, moving subset of faces.

Definition at line 260 of file treeDataFace.H.

Member Function Documentation

◆ ClassName()

ClassName ( "treeDataFace"  )

◆ boxes() [1/3]

Foam::treeBoundBoxList boxes ( const primitiveMesh mesh)
static

Calculate and return bounding boxes for all mesh faces.

Definition at line 90 of file treeDataFace.C.

References Foam::boxesImpl(), treeDataFace::mesh(), and primitiveMesh::nFaces().

Here is the call graph for this function:

◆ boxes() [2/3]

Foam::treeBoundBoxList boxes ( const primitiveMesh mesh,
const labelRange range 
)
static

Calculate and return bounding boxes for specified range of faces.

Definition at line 99 of file treeDataFace.C.

References Foam::boxesImpl(), mesh, and range.

Here is the call graph for this function:

◆ boxes() [3/3]

Foam::treeBoundBoxList boxes ( const primitiveMesh mesh,
const labelUList faceIds 
)
static

Calculate and return bounding boxes for specified mesh faces.

Definition at line 110 of file treeDataFace.C.

References Foam::boxesImpl(), and mesh.

Here is the call graph for this function:

◆ bounds() [1/3]

Foam::treeBoundBox bounds ( const primitiveMesh mesh,
const labelRange range 
)
static

Return bounding box of specified range of faces.

Definition at line 121 of file treeDataFace.C.

References Foam::boundsImpl(), mesh, and range.

Referenced by treeDataFace::bounds().

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

◆ bounds() [2/3]

Foam::treeBoundBox bounds ( const primitiveMesh mesh,
const labelUList faceIds 
)
static

Return bounding box of specified mesh faces.

Definition at line 132 of file treeDataFace.C.

References Foam::boundsImpl(), and mesh.

Here is the call graph for this function:

◆ nDim()

int nDim ( ) const
inlinenoexcept

Object dimension == 2 (face element)

Definition at line 318 of file treeDataFace.H.

◆ bounds() [3/3]

Foam::treeBoundBox bounds ( const labelUList indices) const

Return bounding box for the specified face indices.

Definition at line 256 of file treeDataFace.C.

References boundBox::add(), and treeDataFace::bounds().

Here is the call graph for this function:

◆ mesh()

const primitiveMesh& mesh ( ) const
inlinenoexcept

Reference to the supporting mesh.

Definition at line 331 of file treeDataFace.H.

Referenced by treeDataFace::boxes().

Here is the caller graph for this function:

◆ faceLabels()

const labelList& faceLabels ( ) const
inlinenoexcept

The subset of face ids to use.

Definition at line 336 of file treeDataFace.H.

◆ useSubset()

bool useSubset ( ) const
inlinenoexcept

Use a subset of faces.

Definition at line 341 of file treeDataFace.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Is the effective face selection empty?

Definition at line 346 of file treeDataFace.H.

References UList< T >::empty(), and primitiveMesh::nFaces().

Here is the call graph for this function:

◆ size()

label size ( ) const
inlinenoexcept

The size of the face selection.

Definition at line 354 of file treeDataFace.H.

References primitiveMesh::nFaces(), and UList< T >::size().

Here is the call graph for this function:

◆ objectIndex()

label objectIndex ( const label  index) const
inline

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

Definition at line 362 of file treeDataFace.H.

Referenced by treeDataFace::centre(), treeDataFace::findIntersectOp::operator()(), and treeDataFace::operator[]().

Here is the caller graph for this function:

◆ operator[]()

const face& operator[] ( const label  index) const
inline

Face at specified shape index.

Definition at line 370 of file treeDataFace.H.

References primitiveMesh::faces(), and treeDataFace::objectIndex().

Here is the call graph for this function:

◆ centre()

const point& centre ( const label  index) const
inline

Representative point (face centre) at shape index.

Definition at line 378 of file treeDataFace.H.

References primitiveMesh::faceCentres(), and treeDataFace::objectIndex().

Here is the call graph for this function:

◆ centres()

Foam::tmp< Foam::pointField > centres ( ) const

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

Definition at line 276 of file treeDataFace.C.

References tmp< T >::New().

Here is the call graph for this function:

◆ getVolumeType()

◆ overlaps() [1/2]

bool overlaps ( const label  index,
const treeBoundBox searchBox 
) const

Does (bb of) shape at index overlap searchBox.

Definition at line 528 of file treeDataFace.C.

References boundBox::containsAny(), f(), forAll, treeBoundBox::intersects(), treeBoundBox::overlaps(), points, and UList< T >::size().

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 587 of file treeDataFace.C.

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

Here is the call graph for this function:

◆ 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 640 of file treeDataFace.C.

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

Here is the call graph for this function:

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