OpenFOAM logo
Open Source CFD Toolkit

octree Class Template Reference

Inheritance diagram for octree:

Inheritance graph
[legend]
Collaboration diagram for octree:

Collaboration graph
[legend]
List of all members.

template<class Type>
class Foam::octree< Type >


Public Types

enum  volumeType { UNKNOWN, MIXED, INSIDE, OUTSIDE }
 volume types More...

Public Member Functions

 octree (const treeBoundBox &octreeBb, const Type &shapes, const label minNLevels, const scalar maxLeafRatio, const scalar maxShapeRatio)
 Construct from components.
 ~octree ()
const Type & shapes () const
const treeBoundBoxoctreeBb () const
scalar maxShapeRatio () const
scalar maxLeafRatio () const
label minNLevels () const
treeNode< Type > * topNode () const
label deepestLevel () const
label nEntries () const
label nNodes () const
label nLeaves () const
void setEntries (const label n)
void setNodes (const label n)
void setLeaves (const label n)
label getSampleType (const point &sample) const
 Returns type of sample with respect to nearest shape.
label find (const point &sample) const
 Find shape containing point in tree.
bool findTightest (const point &sample, treeBoundBox &tightest) const
 Calculate tightest fitting bounding box. Uses.
label findNearest (const point &sample, treeBoundBox &tightest, scalar &tightestDist) const
 Find nearest shape. Returns index of shape or -1 if not found.
label findNearest (const linePointRef &ln, treeBoundBox &tightest, point &linePoint, point &shapePoint) const
 Find nearest to line. Returns -1 or index of shape and.
labelList findBox (const boundBox &bb) const
 Find (in no particular order) indices of all shapes inside or.
pointIndexHit findLine (const point &start, const point &end) const
 Find intersected shape along line. pointIndexHit contains index.
pointIndexHit findLineAny (const point &start, const point &end) const
 Like above but just tests whether line hits anything. So.
const treeLeaf< Type > * findLeafLine (const point &start, const point &end, point &leafIntPoint) const
 Find leaf along line. Set leafIntPoint to leave point of.
void writeOBJ (Ostream &os, label &vertNo) const
 Dump graphical representation in .obj format.
void printStats (Ostream &os) const
 Print some stats on octree.
iterator begin ()
 iterator set to the begining of the octree
const iteratorend ()
 iterator set to beyond the end of the octree
const_iterator begin () const
 const_iterator set to the begining of the octree
const const_iteratorend () const
 const_iterator set to beyond the end of the octree

Static Public Member Functions

string volType (const label)
 for debugging:return printable representation of volumeType
label getVolType (const vector &geomNormal, const vector &vec)
 Code the vector with respect to the geometry. geomNormal guaranteed.

Friends

class iterator
class const_iterator
Ostreamoperator (Ostream &, const octree< Type > &)

Member Enumeration Documentation

enum volumeType
 

volume types

Enumeration values:
UNKNOWN 
MIXED 
INSIDE 
OUTSIDE 

Definition at line 190 of file octree.H.


Constructor & Destructor Documentation

octree const treeBoundBox octreeBb,
const Type &  shapes,
const label  minNLevels,
const scalar  maxLeafRatio,
const scalar  maxShapeRatio
 

Construct from components.

~octree  ) 
 


Member Function Documentation

const_iterator begin  )  const [inline]
 

const_iterator set to the begining of the octree

iterator begin  ) 
 

iterator set to the begining of the octree

label deepestLevel  )  const [inline]
 

Definition at line 268 of file octree.H.

const const_iterator& end  )  const [inline]
 

const_iterator set to beyond the end of the octree

const iterator& end  ) 
 

iterator set to beyond the end of the octree

label find const point sample  )  const
 

Find shape containing point in tree.

Returns -1 if not in found. Uses Type::contains.

labelList findBox const boundBox bb  )  const
 

Find (in no particular order) indices of all shapes inside or.

overlapping bounding box (i.e. all shapes not outside box)

const treeLeaf<Type>* findLeafLine const point start,
const point end,
point leafIntPoint
const
 

Find leaf along line. Set leafIntPoint to leave point of.

treeLeaf.

pointIndexHit findLine const point start,
const point end
const
 

Find intersected shape along line. pointIndexHit contains index.

of nearest shape intersected and the intersection point. Uses findLeafLine.

pointIndexHit findLineAny const point start,
const point end
const
 

Like above but just tests whether line hits anything. So.

returns first intersection found, not nessecarily nearest.

label findNearest const linePointRef ln,
treeBoundBox tightest,
point linePoint,
point shapePoint
const
 

Find nearest to line. Returns -1 or index of shape and.

sets:

  • tightest (is both input and output).
  • linePoint : point on line (-GREAT,-GREAT,-GREAT if not found)
  • shapePoint : point on shape (GREAT, GREAT, GREAT if not found) Uses Type::calcNearest.

label findNearest const point sample,
treeBoundBox tightest,
scalar &  tightestDist
const
 

Find nearest shape. Returns index of shape or -1 if not found.

tightestDist is both input and output. Uses Type::calcNearest.

bool findTightest const point sample,
treeBoundBox tightest
const
 

Calculate tightest fitting bounding box. Uses.

Type::findTightest.

label getSampleType const point sample  )  const
 

Returns type of sample with respect to nearest shape.

Meaning of type is determined by shapes.getSampleType(). Normally based on outwards pointing normal. For e.g. octreeDataFace returns one of inside : on other side of normal on nearest face outside : on same side as normal on nearest face unknown : not above nearest face; surface probably not closed. mixed : should never happen

label getVolType const vector geomNormal,
const vector vec
[static]
 

Code the vector with respect to the geometry. geomNormal guaranteed.

to point outside.

scalar maxLeafRatio  )  const [inline]
 

Definition at line 251 of file octree.H.

scalar maxShapeRatio  )  const [inline]
 

Definition at line 246 of file octree.H.

label minNLevels  )  const [inline]
 

Definition at line 256 of file octree.H.

label nEntries  )  const [inline]
 

Definition at line 273 of file octree.H.

label nLeaves  )  const [inline]
 

Definition at line 283 of file octree.H.

label nNodes  )  const [inline]
 

Definition at line 278 of file octree.H.

const treeBoundBox& octreeBb  )  const [inline]
 

Definition at line 241 of file octree.H.

void printStats Ostream os  )  const
 

Print some stats on octree.

void setEntries const label  n  )  [inline]
 

Definition at line 288 of file octree.H.

void setLeaves const label  n  )  [inline]
 

Definition at line 298 of file octree.H.

void setNodes const label  n  )  [inline]
 

Definition at line 293 of file octree.H.

const Type& shapes  )  const [inline]
 

Definition at line 236 of file octree.H.

treeNode<Type>* topNode  )  const [inline]
 

Definition at line 263 of file octree.H.

string volType const   label  )  [static]
 

for debugging:return printable representation of volumeType

void writeOBJ Ostream os,
label vertNo
const
 

Dump graphical representation in .obj format.


Friends And Related Function Documentation

friend class const_iterator [friend]
 

Definition at line 452 of file octree.H.

friend class iterator [friend]
 

Definition at line 405 of file octree.H.

Ostream& operator Ostream ,
const octree< Type > & 
[friend]
 


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