Data Structures | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
treeDataFace Class Reference

Encapsulation of data needed to search for faces. More...

Collaboration diagram for treeDataFace:
Collaboration graph
[legend]

Data Structures

class  findIntersectOp
 
class  findNearestOp
 

Public Member Functions

 ClassName ("treeDataFace")
 
 treeDataFace (const bool cacheBb, const primitiveMesh &, const labelUList &)
 Construct from mesh and subset of faces. More...
 
 treeDataFace (const bool cacheBb, const primitiveMesh &, const Xfer< labelList > &)
 Construct from mesh and subset of faces, transferring contents. More...
 
 treeDataFace (const bool cacheBb, const primitiveMesh &)
 Construct from mesh. Uses all faces in mesh. More...
 
 treeDataFace (const bool cacheBb, const polyPatch &)
 Construct from mesh. Uses all faces in patch. More...
 
const labelListfaceLabels () const
 
const primitiveMeshmesh () const
 
label size () const
 
pointField shapePoints () const
 Get representative point cloud for all shapes inside. 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 &sampleBb) const
 Does (bb of) shape at index overlap bb. More...
 

Private Member Functions

treeBoundBox calcBb (const label cellI) const
 Calculate face bounding box. More...
 
void update ()
 Initialise all member data. More...
 

Private Attributes

const primitiveMeshmesh_
 
const labelList faceLabels_
 Subset of faces to work on. More...
 
PackedBoolList isTreeFace_
 Inverse of faceLabels. For every mesh whether face is in faceLabels. More...
 
const bool cacheBb_
 Whether to precalculate and store face bounding box. More...
 
treeBoundBoxList bbs_
 Face bounding boxes (valid only if cacheBb_) More...
 

Static Private Attributes

static scalar tolSqr = sqr(1e-6)
 Tolerance on linear dimensions. More...
 

Detailed Description

Encapsulation of data needed to search for faces.

Source files

Definition at line 58 of file treeDataFace.H.

Constructor & Destructor Documentation

◆ treeDataFace() [1/4]

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

Construct from mesh and subset of faces.

Definition at line 83 of file treeDataFace.C.

◆ treeDataFace() [2/4]

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

Construct from mesh and subset of faces, transferring contents.

Definition at line 99 of file treeDataFace.C.

◆ treeDataFace() [3/4]

treeDataFace ( const bool  cacheBb,
const primitiveMesh mesh 
)

Construct from mesh. Uses all faces in mesh.

Definition at line 115 of file treeDataFace.C.

◆ treeDataFace() [4/4]

treeDataFace ( const bool  cacheBb,
const polyPatch patch 
)

Construct from mesh. Uses all faces in patch.

Definition at line 130 of file treeDataFace.C.

Member Function Documentation

◆ calcBb()

Foam::treeBoundBox calcBb ( const label  cellI) const
private

Calculate face bounding box.

Definition at line 42 of file treeDataFace.C.

References f(), primitiveMesh::faces(), boundBox::max(), Foam::max(), treeDataFace::mesh_, boundBox::min(), Foam::min(), p, points, and primitiveMesh::points().

Here is the call graph for this function:

◆ update()

void update ( )
private

Initialise all member data.

Definition at line 61 of file treeDataFace.C.

References forAll.

◆ ClassName()

ClassName ( "treeDataFace"  )

◆ faceLabels()

const labelList& faceLabels ( ) const
inline

Definition at line 179 of file treeDataFace.H.

References treeDataFace::faceLabels_.

Referenced by treeDataFace::findNearestOp::operator()().

Here is the caller graph for this function:

◆ mesh()

const primitiveMesh& mesh ( ) const
inline

Definition at line 184 of file treeDataFace.H.

References treeDataFace::mesh_.

Referenced by treeDataFace::findNearestOp::operator()().

Here is the caller graph for this function:

◆ size()

label size ( ) const
inline

Definition at line 189 of file treeDataFace.H.

References treeDataFace::faceLabels_, and List::size().

Here is the call graph for this function:

◆ shapePoints()

Foam::pointField shapePoints ( ) const

Get representative point cloud for all shapes inside.

(one point per shape)

Definition at line 168 of file treeDataFace.C.

References forAll.

◆ getVolumeType()

Foam::volumeType getVolumeType ( const indexedOctree< treeDataFace > &  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 184 of file treeDataFace.C.

References Foam::abort(), Foam::e, Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, indexedOctree::findNearest(), forAll, indexedOctree::getSide(), PointHit::hit(), PointIndexHit< Point >::index(), Foam::mag(), Foam::magSqr(), n, line::nearestDist(), pFaces, points, Foam::Pout, PointHit::rawPoint(), Foam::sqr(), volumeType::UNKNOWN, and Vector< scalar >::zero.

Here is the call graph for this function:

◆ overlaps()

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

Does (bb of) shape at index overlap bb.

Definition at line 439 of file treeDataFace.C.

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

Here is the call graph for this function:

Field Documentation

◆ tolSqr

scalar tolSqr = sqr(1e-6)
staticprivate

Tolerance on linear dimensions.

Definition at line 63 of file treeDataFace.H.

◆ mesh_

const primitiveMesh& mesh_
private

◆ faceLabels_

const labelList faceLabels_
private

Subset of faces to work on.

Definition at line 72 of file treeDataFace.H.

Referenced by treeDataFace::faceLabels(), treeDataFace::findIntersectOp::operator()(), and treeDataFace::size().

◆ isTreeFace_

PackedBoolList isTreeFace_
private

Inverse of faceLabels. For every mesh whether face is in faceLabels.

Definition at line 75 of file treeDataFace.H.

◆ cacheBb_

const bool cacheBb_
private

Whether to precalculate and store face bounding box.

Definition at line 78 of file treeDataFace.H.

Referenced by treeDataFace::findIntersectOp::operator()().

◆ bbs_

treeBoundBoxList bbs_
private

Face bounding boxes (valid only if cacheBb_)

Definition at line 81 of file treeDataFace.H.

Referenced by treeDataFace::findIntersectOp::operator()().


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