FreeFOAM The Cross-Platform CFD Toolkit
treeLeaf< Type > Class Template Reference

An octree treeLeaf. More...

#include <meshTools/treeLeaf.H>


Detailed Description

template<class Type>
class Foam::treeLeaf< Type >

An octree treeLeaf.

Source files

Definition at line 77 of file treeLeaf.H.

+ Inheritance diagram for treeLeaf< Type >:
+ Collaboration diagram for treeLeaf< Type >:

List of all members.

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 labelListindices () 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
- Public Member Functions inherited from treeElem< Type >
 treeElem (const treeBoundBox &bb)
 Construct from bounding box.
const treeBoundBoxbb () const
 Bounding box of this node.
treeBoundBoxbb ()
 Bounding box of this node.

Friends

Istreamoperator>> (Istream &, treeLeaf< Type > &)
Ostreamoperator (Ostream &, const treeLeaf< Type > &)

Constructor & Destructor Documentation

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.

treeLeaf ( Istream is)

Construct from Istream.

Definition at line 67 of file treeLeaf.C.

~treeLeaf ( )

Definition at line 76 of file treeLeaf.C.


Member Function Documentation

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
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(), boundBox::max(), Foam::max(), boundBox::min(), Foam::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

debug:

Definition at line 417 of file treeLeaf.C.

References Foam::endl().

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
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
bool findNearest ( const octreeDataTriSurface shapes,
const point sample,
treeBoundBox tightest,
label &  tightestI,
scalar &  tightestDist 
) const

Friends And Related Function Documentation

Istream& operator>> ( Istream ,
treeLeaf< Type > &   
)
friend
Ostream& operator ( Ostream ,
const treeLeaf< Type > &   
)
friend

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