|
|
|
treeNode Class Template ReferenceInheritance diagram for treeNode:![]() ![]() Detailed Descriptiontemplate<class 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 > &) |
| treeNode | ( | const treeBoundBox & | bb | ) |
Construct from components.
| ~treeNode | ( | ) |
| const point & mid | ( | ) | const [inline] |
| treeElem< Type > *const * subNodes | ( | ) | 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:

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.
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
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
Collect all treeLeafs in leafArray. leafIndex points to first.
empty slot in leafArray and gets updated.
Same but for const.
Write subleafs in OBJ format.