#include <meshTools/treeLeaf.H>
An octree treeLeaf.
Definition at line 77 of file treeLeaf.H.
Inheritance diagram for treeLeaf< Type >:
Collaboration diagram for treeLeaf< Type >:Public Member Functions | |
| treeLeaf (const treeBoundBox &bb, const label size) | |
| Construct with size.
| |
| treeLeaf (const treeBoundBox &bb, const labelList &indices) | |
| Construct from list.
| |
| treeLeaf (Istream &) | |
| Construct from Istream.
| |
| ~treeLeaf () | |
| label | size () const |
| const labelList & | indices () const |
| void | insert (const label index) |
| void | trim () |
| treeLeaf< Type > * | redistribute (const label, octree< Type > &, const Type &) |
| Take indices at refineLevel and distribute them to lower levels.
| |
| label | setSubNodeType (const label level, octree< Type > &top, const Type &shapes) const |
| label | getSampleType (const label level, const octree< Type > &top, const Type &shapes, const point &sample) const |
| Get type of sample.
| |
| 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 fitting bounding box in leaf.
| |
| bool | findNearest (const Type &shapes, const point &sample, treeBoundBox &tightest, label &tightestI, scalar &tightestDist) const |
| Find nearest point.
| |
| 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.
| |
| void | printLeaf (Ostream &, const label) const |
| Debug: print a leaf.
| |
| void | writeOBJ (Ostream &os, const label level, label &vertNo) const |
| Debug: Write bb in OBJ format.
| |
| label | countLeaf (Ostream &, const label) const |
| debug:
| |
| template<> | |
| Foam::label | find (const octreeDataPoint &shapes, const point &sample) const |
| template<> | |
| bool | findNearest (const octreeDataPoint &shapes, const point &sample, treeBoundBox &tightest, label &tightestI, scalar &tightestDist) const |
| template<> | |
| label | find (const octreeDataPoint &shapes, const point &sample) const |
| template<> | |
| bool | findNearest (const octreeDataPoint &shapes, const point &sample, treeBoundBox &tightest, label &tightestI, scalar &tightestDist) const |
| template<> | |
| bool | findNearest (const octreeDataTriSurface &shapes, const point &sample, treeBoundBox &tightest, label &tightestI, scalar &tightestDist) const |
| template<> | |
| bool | findNearest (const octreeDataTriSurface &shapes, const point &sample, treeBoundBox &tightest, label &tightestI, scalar &tightestDist) const |
Friends | |
| Istream & | operator>> (Istream &, treeLeaf< Type > &) |
| Ostream & | operator (Ostream &, const treeLeaf< Type > &) |
| treeLeaf | ( | const treeBoundBox & | bb, |
| const label | size | ||
| ) |
Construct with size.
Definition at line 50 of file treeLeaf.C.
| treeLeaf | ( | const treeBoundBox & | bb, |
| const labelList & | indices | ||
| ) |
Construct from list.
Definition at line 58 of file treeLeaf.C.
Construct from Istream.
Definition at line 67 of file treeLeaf.C.
| ~treeLeaf | ( | ) |
Definition at line 76 of file treeLeaf.C.
| label size | ( | ) | const [inline]
|
Definition at line 125 of file treeLeaf.H.
Referenced by treeNode< Type >::distribute(), and treeNode< Type >::redistribute().
| const labelList& indices | ( | ) | const [inline]
|
Definition at line 130 of file treeLeaf.H.
Referenced by octree< Type >::findLine(), and octree< Type >::findLineAny().
| void insert | ( | const label | index ) | [inline]
|
Definition at line 137 of file treeLeaf.H.
References Foam::abort(), Foam::FatalError, FatalErrorIn, and List< T >::size().
Referenced by treeNode< Type >::distribute().
| void trim | ( | ) | [inline]
|
Definition at line 153 of file treeLeaf.H.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, List< T >::setSize(), and List< T >::size().
Referenced by treeNode< Type >::distribute().
| Foam::treeLeaf< Type > * redistribute | ( | const label | level, |
| octree< Type > & | top, | ||
| const Type & | shapes | ||
| ) |
Take indices at refineLevel and distribute them to lower levels.
Definition at line 85 of file treeLeaf.C.
References treeNode< Type >::distribute(), Foam::endl(), octree< Type >::maxLeafRatio(), octree< Type >::nNodes(), Foam::Pout, and octree< Type >::setNodes().
Referenced by treeNode< Type >::redistribute().
| Foam::label setSubNodeType | ( | const label | level, |
| octree< Type > & | top, | ||
| const Type & | shapes | ||
| ) | const |
Definition at line 138 of file treeLeaf.C.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
| Foam::label getSampleType | ( | const label | level, |
| const octree< Type > & | top, | ||
| const Type & | shapes, | ||
| const point & | sample | ||
| ) | const |
Get type of sample.
Definition at line 159 of file treeLeaf.C.
References treeLeaf< Type >::getSampleType().
Referenced by treeLeaf< Type >::getSampleType().
| Foam::label find | ( | const Type & | shapes, |
| const point & | sample | ||
| ) | const |
Find index of shape containing sample.
Definition at line 172 of file treeLeaf.C.
References forAll.
| bool findTightest | ( | const Type & | shapes, |
| const point & | sample, | ||
| treeBoundBox & | tightest | ||
| ) | const |
Find tightest fitting bounding box in leaf.
Definition at line 191 of file treeLeaf.C.
References forAll.
Referenced by treeNode< Type >::findTightest().
| bool findNearest | ( | const Type & | shapes, |
| const point & | sample, | ||
| treeBoundBox & | tightest, | ||
| label & | tightestI, | ||
| scalar & | tightestDist | ||
| ) | const |
Find nearest point.
Definition at line 215 of file treeLeaf.C.
References dist, Foam::endl(), forAll, boundBox::max(), boundBox::min(), and Foam::Pout.
Referenced by treeNode< Type >::findNearest().
| 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
Definition at line 281 of file treeLeaf.C.
References line< Point, PointRef >::end(), forAll, Foam::mag(), Foam::max(), boundBox::max(), Foam::min(), boundBox::min(), and line< Point, PointRef >::start().
| bool findBox | ( | const Type & | shapes, |
| const boundBox & | bb, | ||
| labelHashSet & | elements | ||
| ) | const |
Find shapes not outside box. Return true if anything found.
Definition at line 334 of file treeLeaf.C.
References forAll, and HashSet< Key, Hash >::insert().
Referenced by treeNode< Type >::findBox().
| void printLeaf | ( | Ostream & | os, |
| const label | level | ||
| ) | const |
Debug: print a leaf.
Definition at line 358 of file treeLeaf.C.
References Foam::endl().
Referenced by treeNode< Type >::printNode().
| void writeOBJ | ( | Ostream & | os, |
| const label | level, | ||
| label & | vertNo | ||
| ) | const |
Debug: Write bb in OBJ format.
Definition at line 377 of file treeLeaf.C.
References Foam::endl(), Foam::max(), Foam::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
| Foam::label countLeaf | ( | Ostream & | os, |
| const label | level | ||
| ) | const |
| Foam::label find | ( | const octreeDataPoint & | shapes, |
| const point & | sample | ||
| ) | const |
Definition at line 36 of file octreeDataPointTreeLeaf.C.
References notImplemented.
| bool findNearest | ( | const octreeDataPoint & | shapes, |
| const point & | sample, | ||
| treeBoundBox & | tightest, | ||
| label & | tightestI, | ||
| scalar & | tightestDist | ||
| ) | const |
Definition at line 54 of file octreeDataPointTreeLeaf.C.
References dist, forAll, magSqr(), boundBox::max(), boundBox::min(), octreeDataPoint::points(), points, sqr(), Foam::sqrt(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
| label find | ( | const octreeDataPoint & | shapes, |
| const point & | sample | ||
| ) | const |
| bool findNearest | ( | const octreeDataPoint & | shapes, |
| const point & | sample, | ||
| treeBoundBox & | tightest, | ||
| label & | tightestI, | ||
| scalar & | tightestDist | ||
| ) | const |
| bool findNearest | ( | const octreeDataTriSurface & | shapes, |
| const point & | sample, | ||
| treeBoundBox & | tightest, | ||
| label & | tightestI, | ||
| scalar & | tightestDist | ||
| ) | const |
Definition at line 35 of file octreeDataTriSurfaceTreeLeaf.C.
References octreeDataTriSurface::allBb(), octreeDataTriSurface::calcNearest(), dist, forAll, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), treeBoundBox::overlaps(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
| bool findNearest | ( | const octreeDataTriSurface & | shapes, |
| const point & | sample, | ||
| treeBoundBox & | tightest, | ||
| label & | tightestI, | ||
| scalar & | tightestDist | ||
| ) | const |