OpenFOAM logo
Open Source CFD Toolkit

treeBoundBox Class Reference

Inheritance diagram for treeBoundBox:

Inheritance graph
[legend]
Collaboration diagram for treeBoundBox:

Collaboration graph
[legend]
List of all members.

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.
vectorList points () const
 vertex coordinates
edgeList edges () const
 edges expressed in terms of points()
point mid () const
 Calculates midpoint.
treeBoundBox subBbox (const label) const
 Sub box given by octant number. Midpoint calculated.
treeBoundBox subBbox (const point &mid, const label) const
 Sub box given by octant number. Midpoint provided.
label subOctant (const point &sample) const
 Returns octant number given point. Midpoint calculated.
label subOctant (const point &sample, bool onEdge) const
 Returns octant number given point. Midpoint calculated.
label subOctant (const point &mid, const point &sample, bool onEdge) const
 Returns octant number given point. Midpoint provided.
label subOctant (const point &mid, const vector &dir, const point &sample, bool onEdge) const
 Returns octant number given intersection. Midpoint provided.
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.
label 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.

Static Public Member Functions

label neighbourFaceBits (const label &)
 Face on which neighbour is.

Static Public Attributes

treeBoundBox greatBox
const label NOFACE = 0
const label LEFTBIT = 0x1 << 0
const label RIGHTBIT = 0x1 << 1
const label BELOWBIT = 0x1 << 2
const label ABOVEBIT = 0x1 << 3
const label BEHINDBIT = 0x1 << 4
const label INFRONTBIT = 0x1 << 5

Friends

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

Constructor & Destructor Documentation

treeBoundBox  )  [inline]
 

Construct null setting points to zero.

Definition at line 49 of file treeBoundBoxI.H.

References Foam::max(), and Foam::min().

Here is the call graph for this function:

treeBoundBox const point min,
const point max
[inline]
 

Construct from components.

Definition at line 56 of file treeBoundBoxI.H.

treeBoundBox const boundBox bb  )  [inline]
 

Construct from components.

Definition at line 63 of file treeBoundBoxI.H.

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

scalar avgDim  )  const
 

Average of length,height,width.

void calcExtremities const point sample,
point nearest,
point furthest
const
 

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

bounding box

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.

bool contains const point  )  const [inline]
 

Contains point? (inside or on edge).

Reimplemented from boundBox.

Definition at line 252 of file treeBoundBoxI.H.

bool contains const treeBoundBox bb  )  const
 

fully contains bb

bool containsNarrow const point  )  const
 

Contains point? (only inside).

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.

edgeList edges  )  const
 

edges expressed in terms of points()

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 intersects const treeBoundBox  )  const [inline]
 

Intersects other boundingbox?

Definition at line 246 of file treeBoundBoxI.H.

scalar maxDim  )  const
 

Largest of length,height,width.

scalar maxDist const point sample  )  const
 

Returns distance sample to furthest away corner.

point mid  )  const
 

Calculates midpoint.

scalar minDim  )  const
 

Smallest of length,height,width.

label neighbourFaceBits const label  )  [static]
 

Face on which neighbour is.

vectorList points  )  const
 

vertex coordinates

label posBits const point  )  const
 

Position of point relative to bb.

treeBoundBox subBbox const point mid,
const   label
const
 

Sub box given by octant number. Midpoint provided.

treeBoundBox subBbox const   label  )  const
 

Sub box given by octant number. Midpoint calculated.

label subOctant const point mid,
const vector dir,
const point sample,
bool  onEdge
const [inline]
 

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 187 of file treeBoundBoxI.H.

label subOctant const point mid,
const point sample,
bool  onEdge
const [inline]
 

Returns octant number given point. Midpoint provided.

onEdge set if sample on edge of subOctant

Definition at line 142 of file treeBoundBoxI.H.

label subOctant const point sample,
bool  onEdge
const [inline]
 

Returns octant number given point. Midpoint calculated.

onEdge set if sample on edge of subOctant

Definition at line 101 of file treeBoundBoxI.H.

label subOctant const point sample  )  const [inline]
 

Returns octant number given point. Midpoint calculated.

Definition at line 72 of file treeBoundBoxI.H.

scalar typDim  )  const
 

Typical dimension length,height,width.


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

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

Definition at line 85 of file treeBoundBox.H.

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

Definition at line 86 of file treeBoundBox.H.

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

Definition at line 84 of file treeBoundBox.H.

treeBoundBox greatBox [static]
 

Definition at line 78 of file treeBoundBox.H.

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

Definition at line 87 of file treeBoundBox.H.

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

Definition at line 82 of file treeBoundBox.H.

const label NOFACE = 0 [static]
 

Definition at line 81 of file treeBoundBox.H.

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

Definition at line 83 of file treeBoundBox.H.


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