OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

treeNode Class Template Reference

Inheritance diagram for treeNode:

Inheritance graph
[legend]
Collaboration diagram for treeNode:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Definition at line 91 of file treeNode.H.


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

const point & mid (  )  const [inline]

position of midPoint

Definition at line 55 of file treeNodeI.H.

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

array of 8 subNodes/leaves

Definition at line 61 of file treeNodeI.H.

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:

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

Get pointer to sub node.

Definition at line 75 of file treeNodeI.H.

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

Get pointer to sub leaf.

Definition at line 92 of file treeNodeI.H.

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.

determination

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.

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

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 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 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< treeLeaf< Type > * > &  leafArray,
label &  leafIndex 
) const

Collect all treeLeafs in leafArray. leafIndex points to first.

empty slot in leafArray and gets updated.

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 And Related Function Documentation

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

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


The documentation for this class was generated from the following files: Copyright © 2000-2007 OpenCFD Ltd