Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
AABBTree Class Reference

Templated tree of axis-aligned bounding boxes (AABB) More...

Collaboration diagram for AABBTree:
Collaboration graph
[legend]

Public Member Functions

 AABBTree ()
 
 AABBTree (const UList< Type > &objects, const pointField &points, const bool equalBinSize=true, const label maxLevel=3, const label minBinSize=100)
 
const List< treeBoundBox > & boundBoxes () const
 
const List< labelList > & addressing () const
 
bool pointInside (const point &pt) const
 
bool overlaps (const boundBox &bbIn) const
 

Protected Member Functions

void writeOBJ (const bool writeLinesOnly, const treeBoundBox &bb, label &vertI, Ostream &os) const
 
void writeOBJ (const bool leavesOnly, const bool writeLinesOnly, const treeBoundBox &bb, const label nodeI, const List< Pair< treeBoundBox >> &bbs, const List< Pair< label >> &nodes, label &vertI, Ostream &os) const
 
void createBoxes (const bool equalBinSize, const label level, const List< Type > &objects, const pointField &points, const DynamicList< label > &objectIDs, const treeBoundBox &bb, const label nodeI, DynamicList< Pair< treeBoundBox >> &bbs, DynamicList< labelPair > &nodes, DynamicList< labelList > &addressing) const
 

Protected Attributes

label maxLevel_
 
label minLeafSize_
 
List< treeBoundBoxboundBoxes_
 
List< labelListaddressing_
 

Static Protected Attributes

static scalar tolerance_ = 1e-4
 

Friends

Istreamoperator>> (Istream &, AABBTree &)
 
Ostreamoperator (Ostream &, const AABBTree &)
 

Detailed Description

Templated tree of axis-aligned bounding boxes (AABB)

Designed to be templated on either faces or cells, the AABBTree will decompose the input into a tree of AABB's. The maximum number of tree levels and minimum number of objects per leaf are provided on construction, and the contents (addressing) is stored.

Source files

Definition at line 55 of file AABBTree.H.

Constructor & Destructor Documentation

◆ AABBTree() [1/2]

AABBTree ( )

Definition at line 315 of file AABBTree.C.

◆ AABBTree() [2/2]

AABBTree ( const UList< Type > &  objects,
const pointField points,
const bool  equalBinSize = true,
const label  maxLevel = 3,
const label  minBinSize = 100 
)

Member Function Documentation

◆ writeOBJ() [1/2]

void writeOBJ ( const bool  writeLinesOnly,
const treeBoundBox bb,
label &  vertI,
Ostream os 
) const
protected

Definition at line 34 of file AABBTree.C.

References Foam::constant::electromagnetic::e, treeBoundBox::edges, f(), treeBoundBox::faces, Foam::nl, os(), treeBoundBox::points(), and Foam::meshTools::writeOBJ().

Here is the call graph for this function:

◆ writeOBJ() [2/2]

void writeOBJ ( const bool  leavesOnly,
const bool  writeLinesOnly,
const treeBoundBox bb,
const label  nodeI,
const List< Pair< treeBoundBox >> &  bbs,
const List< Pair< label >> &  nodes,
label &  vertI,
Ostream os 
) const
protected

Definition at line 73 of file AABBTree.C.

References os(), AABBTree::writeOBJ(), and Foam::meshTools::writeOBJ().

Referenced by AABBTree::writeOBJ().

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

◆ createBoxes()

void createBoxes ( const bool  equalBinSize,
const label  level,
const List< Type > &  objects,
const pointField points,
const DynamicList< label > &  objectIDs,
const treeBoundBox bb,
const label  nodeI,
DynamicList< Pair< treeBoundBox >> &  bbs,
DynamicList< labelPair > &  nodes,
DynamicList< labelList > &  addressing 
) const
protected

◆ boundBoxes()

const Foam::List< Foam::treeBoundBox > & boundBoxes ( ) const

Definition at line 435 of file AABBTree.C.

Referenced by faceAreaWeightAMI2D::overlappingTgtFaces().

Here is the caller graph for this function:

◆ addressing()

const Foam::List< Foam::labelList > & addressing ( ) const

Definition at line 442 of file AABBTree.C.

Referenced by faceAreaWeightAMI2D::overlappingTgtFaces().

Here is the caller graph for this function:

◆ pointInside()

bool pointInside ( const point pt) const

Definition at line 449 of file AABBTree.C.

References treeBoundBox::contains().

Here is the call graph for this function:

◆ overlaps()

bool overlaps ( const boundBox bbIn) const

Definition at line 464 of file AABBTree.C.

References treeBoundBox::overlaps().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
AABBTree  
)
friend

◆ operator

Ostream& operator ( Ostream ,
const AABBTree  
)
friend

Member Data Documentation

◆ tolerance_

Foam::scalar tolerance_ = 1e-4
staticprotected

Definition at line 76 of file AABBTree.H.

◆ maxLevel_

label maxLevel_
protected

Definition at line 79 of file AABBTree.H.

◆ minLeafSize_

label minLeafSize_
protected

Definition at line 82 of file AABBTree.H.

◆ boundBoxes_

List<treeBoundBox> boundBoxes_
protected

Definition at line 85 of file AABBTree.H.

◆ addressing_

List<labelList> addressing_
protected

Definition at line 88 of file AABBTree.H.


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