OpenFOAM logo
Open Source CFD Toolkit

treeNode Class Template Reference

Inheritance diagram for treeNode:

Inheritance graph
[legend]
Collaboration diagram for treeNode:

Collaboration graph
[legend]
List of all members.

template<class Type>
class Foam::treeNode< Type >


Public Member Functions

 treeNode (const treeBoundBox &bb)
 Construct from components.
 treeNode (Istream &)
 Construct from Istream.
 ~treeNode ()
const point & mid () const
 position of midPoint
treeElem< Type > *const * subNodes () const
 array of 8 subNodes/leaves
label isNode (const label octant) const
 octant contains pointer to treeNode(1) or treeLeaf(0)
treeNode< Type > * getNodePtr (const label octant) const
 Get pointer to sub node.
treeLeaf< Type > * getLeafPtr (const label octant) const
 Get pointer to sub leaf.
void distribute (const label, octree< Type > &, const Type &shapes, const labelList &)
 Take list of shapes and distribute over the 8 octants.
void redistribute (const label, octree< Type > &, const Type &shapes, const label)
 Distribute at certain level only.
label setSubNodeType (const label level, octree< Type > &top, const Type &shapes)
 Set type of subnodes.
label getSampleType (const label level, const octree< Type > &top, const Type &shapes, const point &sample) const
 Find type of node sample is in. Used for inside/outside.
label find (const Type &shapes, const point &sample) const
 Find index of shape containing sample.
bool findTightest (const Type &shapes, const point &sample, treeBoundBox &tightest) const
 Find tightest bounding box around sample which is guaranteed.
bool findNearest (const Type &shapes, const point &sample, treeBoundBox &tightest, label &tightesti, scalar &tightestDist) const
 Find nearest shape to sample.
bool findNearest (const Type &shapes, const linePointRef &ln, treeBoundBox &tightest, label &tightesti, point &linePoint, point &shapePoint) const
 Find nearest shape to line.
bool findBox (const Type &shapes, const boundBox &bb, labelHashSet &elements) const
 Find shapes not outside box. Return true if anything found.
const treeLeaf< Type > * findLeafLine (const label level, const Type &shapes, point &start, const point &end) const
 Find treeLeaves intersecting line segment [start..end].
void findLeaves (List< treeLeaf< Type > * > &leafArray, label &leafIndex) const
 Collect all treeLeafs in leafArray. leafIndex points to first.
void findLeaves (List< const treeLeaf< Type > * > &leafArray, label &leafIndex) const
 Same but for const.
void printNode (Ostream &os, const label level) const
 Print contents of node.
void writeOBJ (Ostream &os, const label level, label &vertNo) const
 Write subleafs in OBJ format.

Friends

Istream & operator>> (Istream &, treeNode< Type > &)
Ostream & operator (Ostream &, const treeNode< Type > &)

Constructor & Destructor Documentation

treeNode (  const treeBoundBox &  bb  ) 
 

Construct from components.

treeNode (  Istream &   ) 
 

Construct from Istream.

~treeNode (   ) 
 


Member Function Documentation

void distribute (  const   label,
octree< Type > &  ,
const Type &  shapes,
const labelList & 
) 
 

Take list of shapes and distribute over the 8 octants.

label find (  const Type &  shapes,
const point &  sample
)  const
 

Find index of shape containing sample.

bool findBox (  const Type &  shapes,
const boundBox &  bb,
labelHashSet &  elements
)  const
 

Find shapes not outside box. Return true if anything found.

const treeLeaf<Type>* findLeafLine (  const label  level,
const Type &  shapes,
point &  start,
const point &  end
)  const
 

Find treeLeaves intersecting line segment [start..end].

Updates: start

void findLeaves (  List< const treeLeaf< Type > * > &  leafArray,
label &  leafIndex
)  const
 

Same but for const.

void findLeaves (  List< treeLeaf< Type > * > &  leafArray,
label &  leafIndex
)  const
 

Collect all treeLeafs in leafArray. leafIndex points to first.

empty slot in leafArray and gets updated.

bool findNearest (  const Type &  shapes,
const linePointRef &  ln,
treeBoundBox &  tightest,
label &  tightesti,
point &  linePoint,
point &  shapePoint
)  const
 

Find nearest shape to line.

Returns true if found nearer shape and updates nearest and tightest

bool findNearest (  const Type &  shapes,
const point &  sample,
treeBoundBox &  tightest,
label &  tightesti,
scalar &  tightestDist
)  const
 

Find nearest shape to sample.

Returns true if found nearer shape and updates tightest, tightesti, tightestDist

bool findTightest (  const Type &  shapes,
const point &  sample,
treeBoundBox &  tightest
)  const
 

Find tightest bounding box around sample which is guaranteed.

to hold at least one cell. Current best bb in tightest, returns true if newTightest has changed, 0 otherwise.

treeLeaf< Type > * getLeafPtr (  const label  octant  )  const [inline]
 

Get pointer to sub leaf.

Definition at line 92 of file treeNodeI.H.

treeNode< Type > * getNodePtr (  const label  octant  )  const [inline]
 

Get pointer to sub node.

Definition at line 75 of file treeNodeI.H.

label getSampleType (  const label  level,
const octree< Type > &  top,
const Type &  shapes,
const point &  sample
)  const
 

Find type of node sample is in. Used for inside/outside.

determination

label isNode (  const label  octant  )  const [inline]
 

octant contains pointer to treeNode(1) or treeLeaf(0)

Definition at line 68 of file treeNodeI.H.

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

Here is the call graph for this function:

const point & mid (   )  const [inline]
 

position of midPoint

Definition at line 55 of file treeNodeI.H.

void printNode (  Ostream &  os,
const label  level
)  const
 

Print contents of node.

void redistribute (  const   label,
octree< Type > &  ,
const Type &  shapes,
const   label
) 
 

Distribute at certain level only.

label setSubNodeType (  const label  level,
octree< Type > &  top,
const Type &  shapes
) 
 

Set type of subnodes.

treeElem< Type > *const * subNodes (   )  const [inline]
 

array of 8 subNodes/leaves

Definition at line 61 of file treeNodeI.H.

void writeOBJ (  Ostream &  os,
const label  level,
label &  vertNo
)  const
 

Write subleafs in OBJ format.


Friends And Related Function Documentation

Ostream& operator (  Ostream &  ,
const treeNode< Type > & 
)  [friend]
 

Istream& operator>> (  Istream &  ,
treeNode< Type > & 
)  [friend]
 


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org