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

octree Class Template Reference

Inheritance diagram for octree:

Inheritance graph
[legend]
Collaboration diagram for octree:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Definition at line 131 of file octree.H.


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 treeBoundBox & octreeBb () 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 iterator & end ()
 iterator set to beyond the end of the octree
const_iterator begin () const
 const_iterator set to the begining of the octree
const const_iterator & end () const
 const_iterator set to beyond the end of the octree

Static Public Member Functions

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

Friends

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

Classes

class  const_iterator
class  iterator

Member Enumeration Documentation

enum volumeType

volume types

Enumerator:
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

static string volType ( const   label  )  [static]

for debugging:return printable representation of volumeType

static label getVolType ( const vector &  geomNormal,
const vector &  vec 
) [static]

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

to point outside.

const Type& shapes (  )  const [inline]

Definition at line 236 of file octree.H.

const treeBoundBox& octreeBb (  )  const [inline]

Definition at line 241 of file octree.H.

scalar maxShapeRatio (  )  const [inline]

Definition at line 246 of file octree.H.

scalar maxLeafRatio (  )  const [inline]

Definition at line 251 of file octree.H.

label minNLevels (  )  const [inline]

Definition at line 256 of file octree.H.

treeNode<Type>* topNode (  )  const [inline]

Definition at line 263 of file octree.H.

label deepestLevel (  )  const [inline]

Definition at line 268 of file octree.H.

label nEntries (  )  const [inline]

Definition at line 273 of file octree.H.

label nNodes (  )  const [inline]

Definition at line 278 of file octree.H.

label nLeaves (  )  const [inline]

Definition at line 283 of file octree.H.

void setEntries ( const label  n  )  [inline]

Definition at line 288 of file octree.H.

void setNodes ( const label  n  )  [inline]

Definition at line 293 of file octree.H.

void setLeaves ( const label  n  )  [inline]

Definition at line 298 of file octree.H.

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 find ( const point &  sample  )  const

Find shape containing point in tree.

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

bool findTightest ( const point &  sample,
treeBoundBox &  tightest 
) const

Calculate tightest fitting bounding box. Uses.

Type::findTightest.

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.

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.

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)

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.

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

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

treeLeaf.

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 iterator& end (  ) 

iterator set to beyond the end of the octree

const_iterator begin (  )  const [inline]

const_iterator set to the begining of the octree

const const_iterator& end (  )  const [inline]

const_iterator set to beyond the end of the octree


Friends And Related Function Documentation

friend class iterator [friend]

Definition at line 404 of file octree.H.

friend class const_iterator [friend]

Definition at line 451 of file octree.H.

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


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