Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
dynamicIndexedOctree Class Reference

Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted. More...

Classes

class  node
 

Public Member Functions

 dynamicIndexedOctree (const Type &shapes, const treeBoundBox &bb, const label maxLevels, const scalar maxLeafRatio, const scalar maxDuplicity)
 
autoPtr< dynamicIndexedOctree< Type > > clone () const
 
const Type & shapes () const
 
const List< node > & nodes () const
 
const contentListListcontents () const
 
const treeBoundBoxbb () const
 
pointIndexHit findNearest (const point &sample, const scalar nearestDistSqr) const
 
void findNearest (const label nodeI, const point &, scalar &nearestDistSqr, label &nearestShapeI, point &nearestPoint) const
 
pointIndexHit findNearest (const linePointRef &ln, treeBoundBox &tightest, point &linePoint) const
 
pointIndexHit findLine (const point &start, const point &end) const
 
pointIndexHit findLineAny (const point &start, const point &end) const
 
labelList findBox (const treeBoundBox &bb) const
 
labelList findSphere (const point &centre, const scalar radiusSqr) const
 
labelBits findNode (const label nodeI, const point &) const
 
label findInside (const point &) const
 
const labelListfindIndices (const point &) const
 
volumeType getVolumeType (const point &) const
 
template<class CompareOp >
void findNear (const scalar nearDist, const dynamicIndexedOctree< Type > &tree2, CompareOp &cop) const
 
bool insert (label startIndex, label endIndex)
 
bool insertIndex (const label nodIndex, const label index, label &nLevels)
 
bool remove (const label index)
 
label removeIndex (const label nodIndex, const label index)
 
void print (prefixOSstream &, const bool printContents, const label) const
 
bool write (Ostream &os) const
 
void writeTreeInfo () const
 

Static Public Member Functions

static scalar & perturbTol ()
 
static bool isContent (const labelBits i)
 
static bool isEmpty (const labelBits i)
 
static bool isNode (const labelBits i)
 
static label getContent (const labelBits i)
 
static label getNode (const labelBits i)
 
static direction getOctant (const labelBits i)
 
static volumeType getSide (const vector &outsideNormal, const vector &vec)
 
static bool overlaps (const point &bbMin, const point &bbMax, const scalar nearestDistSqr, const point &sample)
 

Friends

Ostreamoperator (Ostream &, const dynamicIndexedOctree< Type > &)
 

Detailed Description

Non-pointer based hierarchical recursive searching. Storage is dynamic, so elements can be deleted.

Source files

Definition at line 53 of file dynamicIndexedOctree.H.

Constructor & Destructor Documentation

◆ dynamicIndexedOctree()

dynamicIndexedOctree ( const Type &  shapes,
const treeBoundBox bb,
const label  maxLevels,
const scalar  maxLeafRatio,
const scalar  maxDuplicity 
)

Definition at line 2130 of file dynamicIndexedOctree.C.

References Foam::expressions::patchExpr::debug, and insert().

Here is the call graph for this function:

Member Function Documentation

◆ perturbTol()

Foam::scalar & perturbTol ( )
static

Definition at line 2166 of file dynamicIndexedOctree.C.

◆ clone()

autoPtr<dynamicIndexedOctree<Type> > clone ( ) const
inline

Definition at line 416 of file dynamicIndexedOctree.H.

References Foam::New().

Here is the call graph for this function:

◆ shapes()

const Type& shapes ( ) const
inline

Definition at line 427 of file dynamicIndexedOctree.H.

◆ nodes()

const List<node>& nodes ( ) const
inline

Definition at line 433 of file dynamicIndexedOctree.H.

◆ contents()

const contentListList& contents ( ) const
inline

Definition at line 440 of file dynamicIndexedOctree.H.

◆ bb()

const treeBoundBox& bb ( ) const
inline

Definition at line 446 of file dynamicIndexedOctree.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Referenced by dynamicIndexedOctree::findNear().

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

◆ isContent()

static bool isContent ( const labelBits  i)
inlinestatic

Definition at line 459 of file dynamicIndexedOctree.H.

References labelBits::val().

Referenced by dynamicIndexedOctree::getContent().

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

◆ isEmpty()

static bool isEmpty ( const labelBits  i)
inlinestatic

Definition at line 464 of file dynamicIndexedOctree.H.

References labelBits::val().

Here is the call graph for this function:

◆ isNode()

static bool isNode ( const labelBits  i)
inlinestatic

Definition at line 469 of file dynamicIndexedOctree.H.

References labelBits::val().

Referenced by dynamicIndexedOctree::getNode().

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

◆ getContent()

static label getContent ( const labelBits  i)
inlinestatic

Definition at line 474 of file dynamicIndexedOctree.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, dynamicIndexedOctree::isContent(), and labelBits::val().

Here is the call graph for this function:

◆ getNode()

static label getNode ( const labelBits  i)
inlinestatic

Definition at line 484 of file dynamicIndexedOctree.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, dynamicIndexedOctree::isNode(), and labelBits::val().

Here is the call graph for this function:

◆ getOctant()

static direction getOctant ( const labelBits  i)
inlinestatic

Definition at line 494 of file dynamicIndexedOctree.H.

References labelBits::bits().

Here is the call graph for this function:

◆ findNearest() [1/3]

pointIndexHit findNearest ( const point sample,
const scalar  nearestDistSqr 
) const

◆ findNearest() [2/3]

void findNearest ( const label  nodeI,
const point ,
scalar &  nearestDistSqr,
label &  nearestShapeI,
point nearestPoint 
) const

◆ findNearest() [3/3]

Foam::pointIndexHit findNearest ( const linePointRef ln,
treeBoundBox tightest,
point linePoint 
) const

Definition at line 2202 of file dynamicIndexedOctree.C.

References Foam::ln(), and Foam::Zero.

Here is the call graph for this function:

◆ findLine()

Foam::pointIndexHit findLine ( const point start,
const point end 
) const

Definition at line 2235 of file dynamicIndexedOctree.C.

References stdFoam::end().

Here is the call graph for this function:

◆ findLineAny()

Foam::pointIndexHit findLineAny ( const point start,
const point end 
) const

Definition at line 2246 of file dynamicIndexedOctree.C.

References stdFoam::end().

Here is the call graph for this function:

◆ findBox()

labelList findBox ( const treeBoundBox bb) const

◆ findSphere()

Foam::labelList findSphere ( const point centre,
const scalar  radiusSqr 
) const

Definition at line 2277 of file dynamicIndexedOctree.C.

◆ findNode()

Foam::labelBits findNode ( const label  nodeI,
const point sample 
) const

◆ findInside()

Foam::label findInside ( const point sample) const

Definition at line 2345 of file dynamicIndexedOctree.C.

References forAll, Foam::getOctant(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ findIndices()

const Foam::labelList & findIndices ( const point sample) const

Definition at line 2377 of file dynamicIndexedOctree.C.

References Foam::getOctant(), and dynamicIndexedOctree::node::subNodes_.

Here is the call graph for this function:

◆ getVolumeType()

volumeType getVolumeType ( const point ) const

◆ getSide()

Foam::volumeType getSide ( const vector outsideNormal,
const vector vec 
)
static

Definition at line 445 of file dynamicIndexedOctree.C.

◆ overlaps()

static bool overlaps ( const point bbMin,
const point bbMax,
const scalar  nearestDistSqr,
const point sample 
)
static

◆ findNear()

void findNear ( const scalar  nearDist,
const dynamicIndexedOctree< Type > &  tree2,
CompareOp &  cop 
) const

Definition at line 2469 of file dynamicIndexedOctree.C.

References dynamicIndexedOctree::bb().

Here is the call graph for this function:

◆ insert()

bool insert ( label  startIndex,
label  endIndex 
)

Definition at line 2491 of file dynamicIndexedOctree.C.

References Foam::divide(), Foam::max(), and success.

Here is the call graph for this function:

◆ insertIndex()

bool insertIndex ( const label  nodIndex,
const label  index,
label &  nLevels 
)

Definition at line 2538 of file dynamicIndexedOctree.C.

References treeBoundBox::subBbox().

Here is the call graph for this function:

◆ remove()

bool remove ( const label  index)

Definition at line 2614 of file dynamicIndexedOctree.C.

◆ removeIndex()

Foam::label removeIndex ( const label  nodIndex,
const label  index 
)

Definition at line 2629 of file dynamicIndexedOctree.C.

References DynamicList::append(), forAll, DynamicList::shrink(), treeBoundBox::subBbox(), and DynamicList::transfer().

Here is the call graph for this function:

◆ print()

void print ( prefixOSstream os,
const bool  printContents,
const label  nodeI 
) const

◆ write()

bool write ( Ostream os) const

Definition at line 2810 of file dynamicIndexedOctree.C.

References os().

Here is the call graph for this function:

◆ writeTreeInfo()

void writeTreeInfo ( ) const

Definition at line 2784 of file dynamicIndexedOctree.C.

References Foam::endl(), forAll, Foam::nl, and Foam::Pout.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream ,
const dynamicIndexedOctree< Type > &   
)
friend

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