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

treeBoundBox Class Reference

Inheritance diagram for treeBoundBox:

Inheritance graph
[legend]
Collaboration diagram for treeBoundBox:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 63 of file treeBoundBox.H.


Public Member Functions

 treeBoundBox ()
 Construct null setting points to zero.
 treeBoundBox (const point &min, const point &max)
 Construct from components.
 treeBoundBox (const boundBox &bb)
 Construct from components.
 treeBoundBox (const pointField &points)
 Construct as the bounding box of the given pointField. Local.
 treeBoundBox (Istream &)
 Construct from Istream.
scalar minDim () const
 Smallest of length,height,width.
scalar maxDim () const
 Largest of length,height,width.
scalar avgDim () const
 Average of length,height,width.
scalar typDim () const
 Typical dimension length,height,width.
pointField points () const
 vertex coordinates
edgeList edges () const
 edges expressed in terms of points()
point mid () const
 Calculates midpoint.
treeBoundBox subBbox (const direction) const
 Sub box given by octant number. Midpoint calculated.
treeBoundBox subBbox (const point &mid, const direction) const
 Sub box given by octant number. Midpoint provided.
direction subOctant (const point &sample) const
 Returns octant number given point. Midpoint calculated.
direction subOctant (const point &mid, bool &onEdge) const
 Returns octant number given point. Midpoint calculated.
bool intersects (const treeBoundBox &) const
 Intersects other boundingbox?
bool intersects (const point &, const point &, point &intPt) const
 Intersects segment; set point to intersection position,.
bool contains (const treeBoundBox &bb) const
 fully contains bb
bool contains (const point &) const
 Contains point? (inside or on edge).
bool containsNarrow (const point &) const
 Contains point? (only inside).
bool contains (const vector &dir, const point &) const
 Contains point inside or.
direction posBits (const point &) const
 Position of point relative to bb.
void calcExtremities (const point &sample, point &nearest, point &furthest) const
 Calculate nearest and furthest (to sample) vertex coords of.
scalar maxDist (const point &sample) const
 Returns distance sample to furthest away corner.
label distanceCmp (const point &, const treeBoundBox &other) const
 Compare distance to point with other bounding box.
treeBoundBox extend (Random &, const scalar s) const
 Return slightly wider bounding box.

Static Public Member Functions

static direction neighbourFaceBits (const label &)
 Face on which neighbour is.
static direction subOctant (const point &mid, const point &sample)
 Returns octant number given point. Midpoint provided.
static direction subOctant (const point &mid, const point &sample, bool &onEdge)
 Returns octant number given point. Midpoint provided.
static direction subOctant (const point &mid, const vector &dir, const point &sample, bool &onEdge)
 Returns octant number given intersection. Midpoint provided.

Static Public Attributes

static treeBoundBox greatBox
static const direction RIGHTHALF = 0x1 << 0
static const direction TOPHALF = 0x1 << 1
static const direction FRONTHALF = 0x1 << 2
static const direction NOFACE = 0
static const direction LEFTBIT = 0x1 << 0
static const direction RIGHTBIT = 0x1 << 1
static const direction BELOWBIT = 0x1 << 2
static const direction ABOVEBIT = 0x1 << 3
static const direction BEHINDBIT = 0x1 << 4
static const direction INFRONTBIT = 0x1 << 5

Friends

bool operator== (const treeBoundBox &, const treeBoundBox &)
bool operator!= (const treeBoundBox &, const treeBoundBox &)
Istream & operator>> (Istream &, treeBoundBox &)

Constructor & Destructor Documentation

treeBoundBox (  )  [inline]

Construct null setting points to zero.

Definition at line 50 of file treeBoundBoxI.H.

treeBoundBox ( const point &  min,
const point &  max 
) [inline]

Construct from components.

Definition at line 57 of file treeBoundBoxI.H.

treeBoundBox ( const boundBox &  bb  )  [inline]

Construct from components.

Definition at line 64 of file treeBoundBoxI.H.

References boundBox::max(), boundBox::min(), Vector::x(), Vector::y(), and Vector::z().

Here is the call graph for this function:

treeBoundBox ( const pointField &  points  ) 

Construct as the bounding box of the given pointField. Local.

processor domain only (no reduce as in boundBox)

treeBoundBox ( Istream &   ) 

Construct from Istream.


Member Function Documentation

static direction neighbourFaceBits ( const label &   )  [static]

Face on which neighbour is.

scalar minDim (  )  const

Smallest of length,height,width.

scalar maxDim (  )  const

Largest of length,height,width.

scalar avgDim (  )  const

Average of length,height,width.

scalar typDim (  )  const

Typical dimension length,height,width.

pointField points (  )  const

vertex coordinates

edgeList edges (  )  const

edges expressed in terms of points()

point mid (  )  const

Calculates midpoint.

treeBoundBox subBbox ( const   direction  )  const

Sub box given by octant number. Midpoint calculated.

treeBoundBox subBbox ( const point &  mid,
const   direction 
) const

Sub box given by octant number. Midpoint provided.

direction subOctant ( const point &  sample  )  const [inline]

Returns octant number given point. Midpoint calculated.

Definition at line 73 of file treeBoundBoxI.H.

References treeBoundBox::RIGHTHALF.

direction subOctant ( const point &  mid,
const point &  sample 
) [inline, static]

Returns octant number given point. Midpoint provided.

Definition at line 103 of file treeBoundBoxI.H.

References treeBoundBox::RIGHTHALF.

direction subOctant ( const point &  mid,
bool &  onEdge 
) const [inline]

Returns octant number given point. Midpoint calculated.

onEdge set if sample on edge of subOctant

Definition at line 131 of file treeBoundBoxI.H.

References treeBoundBox::RIGHTHALF.

direction subOctant ( const point &  mid,
const point &  sample,
bool &  onEdge 
) [inline, static]

Returns octant number given point. Midpoint provided.

onEdge set if sample on edge of subOctant

Definition at line 173 of file treeBoundBoxI.H.

References treeBoundBox::RIGHTHALF.

direction subOctant ( const point &  mid,
const vector &  dir,
const point &  sample,
bool &  onEdge 
) [inline, static]

Returns octant number given intersection. Midpoint provided.

onEdge set if sample on edge of subOctant. If onEdge the direction vector determines which octant to use (acc. to which octant the sample would be if it were moved along dir)

Definition at line 218 of file treeBoundBoxI.H.

References treeBoundBox::RIGHTHALF.

bool intersects ( const treeBoundBox &   )  const [inline]

Intersects other boundingbox?

Definition at line 277 of file treeBoundBoxI.H.

bool intersects ( const point &  ,
const point &  ,
point &  intPt 
) const

Intersects segment; set point to intersection position,.

return true if intersection found. (intPt argument used during calculation even if not intersecting)

bool contains ( const treeBoundBox &  bb  )  const

fully contains bb

bool contains ( const point &   )  const [inline]

Contains point? (inside or on edge).

Reimplemented from boundBox.

Definition at line 283 of file treeBoundBoxI.H.

bool containsNarrow ( const point &   )  const

Contains point? (only inside).

bool contains ( const vector &  dir,
const point &   
) const

Contains point inside or.

on edge and moving in direction dir would cause it to go inside.

direction posBits ( const point &   )  const

Position of point relative to bb.

void calcExtremities ( const point &  sample,
point &  nearest,
point &  furthest 
) const

Calculate nearest and furthest (to sample) vertex coords of.

bounding box

scalar maxDist ( const point &  sample  )  const

Returns distance sample to furthest away corner.

label distanceCmp ( const point &  ,
const treeBoundBox &  other 
) const

Compare distance to point with other bounding box.

return: -1 : all vertices of my bounding box are nearer than any of other +1 : all vertices of my bounding box are further away than any of other 0 : none of the above.

treeBoundBox extend ( Random &  ,
const scalar  s 
) const [inline]

Return slightly wider bounding box.

Extends all dimensions with s*span*Randomscalar01()

Definition at line 298 of file treeBoundBoxI.H.


Friends And Related Function Documentation

bool operator== ( const treeBoundBox &  ,
const treeBoundBox &   
) [friend]

bool operator!= ( const treeBoundBox &  ,
const treeBoundBox &   
) [friend]

Istream& operator>> ( Istream &  ,
treeBoundBox &   
) [friend]


Member Data Documentation

Definition at line 72 of file treeBoundBox.H.

const direction RIGHTHALF = 0x1 << 0 [static]

Definition at line 75 of file treeBoundBox.H.

Referenced by treeBoundBox::subOctant().

const direction TOPHALF = 0x1 << 1 [static]

Definition at line 76 of file treeBoundBox.H.

const direction FRONTHALF = 0x1 << 2 [static]

Definition at line 77 of file treeBoundBox.H.

const direction NOFACE = 0 [static]

Definition at line 80 of file treeBoundBox.H.

const direction LEFTBIT = 0x1 << 0 [static]

Definition at line 81 of file treeBoundBox.H.

const direction RIGHTBIT = 0x1 << 1 [static]

Definition at line 82 of file treeBoundBox.H.

const direction BELOWBIT = 0x1 << 2 [static]

Definition at line 83 of file treeBoundBox.H.

const direction ABOVEBIT = 0x1 << 3 [static]

Definition at line 84 of file treeBoundBox.H.

const direction BEHINDBIT = 0x1 << 4 [static]

Definition at line 85 of file treeBoundBox.H.

const direction INFRONTBIT = 0x1 << 5 [static]

Definition at line 86 of file treeBoundBox.H.


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