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

indexedOctree Class Template Reference

Inheritance diagram for indexedOctree:

Inheritance graph
[legend]
Collaboration diagram for indexedOctree:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class Type>
class Foam::indexedOctree< Type >

Definition at line 76 of file indexedOctree.H.


Public Types

enum  volumeType { UNKNOWN = 0, MIXED = 1, INSIDE = 2, OUTSIDE = 3 }
 volume types More...

Public Member Functions

 indexedOctree (const Type &shapes)
 Construct null.
 indexedOctree (const Type &shapes, const List< node > &nodes, const labelListList &contents)
 Construct from components.
 indexedOctree (const Type &shapes, const treeBoundBox &bb, const label maxLevels, const scalar maxLeafRatio, const scalar maxDuplicity)
 Construct from shapes.
 indexedOctree (const Type &shapes, Istream &is)
 Construct from Istream.
const Type & shapes () const
 Reference to shape.
const List< node > & nodes () const
 List of all nodes.
const labelListList & contents () const
 List of all contents (referenced by those nodes that are.
const treeBoundBox & bb () const
 Top bounding box.
pointIndexHit findNearest (const point &sample, const scalar nearestDistSqr) const
 Calculate nearest point on nearest shape. Returns.
void findNearest (const label nodeI, const point &, scalar &nearestDistSqr, label &nearestShapeI, point &nearestPoint) const
 Low level: calculate nearest starting from subnode.
pointIndexHit findNearest (const linePointRef &ln, treeBoundBox &tightest, point &linePoint) const
 Find nearest to line. Returns.
pointIndexHit findLine (const point &start, const point &end) const
 Find nearest intersection of line between start and end.
pointIndexHit findLineAny (const point &start, const point &end) const
 Find any intersection of line between start and end.
labelList findBox (const boundBox &bb) const
 Find (in no particular order) indices of all shapes inside or.
labelBits findNode (const label nodeI, const point &) const
 Find deepest node (as parent+octant) containing point. Starts.
volumeType getVolumeType (const point &) const
 Determine type (inside/outside/mixed) for point. unknown if.
void print (prefixOSstream &, const bool printContents, const label) const
 Print tree. Either print all indices (printContent = true) or.
bool write (Ostream &os) const

Static Public Member Functions

static bool isContent (const labelBits i)
static bool isEmpty (const labelBits i)
static bool isNode (const labelBits i)
static label getContent (const labelBits i)
static label getNode (const labelBits i)
static direction getOctant (const labelBits i)
static bool intersects (const point &bbMin, const point &bbMax, const scalar nearestDistSqr, const point &sample)
 Helper: does bb intersect a sphere around sample? Or is any.

Friends

Ostream & operator (Ostream &, const indexedOctree< Type > &)

Classes

class  node

Member Enumeration Documentation

enum volumeType

volume types

Enumerator:
UNKNOWN 
MIXED 
INSIDE 
OUTSIDE 

Definition at line 85 of file indexedOctree.H.


Constructor & Destructor Documentation

indexedOctree ( const Type &  shapes  ) 

Construct null.

indexedOctree ( const Type &  shapes,
const List< node > &  nodes,
const labelListList &  contents 
)

Construct from components.

indexedOctree ( const Type &  shapes,
const treeBoundBox &  bb,
const label  maxLevels,
const scalar  maxLeafRatio,
const scalar  maxDuplicity 
)

Construct from shapes.

indexedOctree ( const Type &  shapes,
Istream &  is 
)

Construct from Istream.


Member Function Documentation

const Type& shapes (  )  const [inline]

Reference to shape.

Definition at line 364 of file indexedOctree.H.

const List<node>& nodes (  )  const [inline]

List of all nodes.

Definition at line 370 of file indexedOctree.H.

const labelListList& contents (  )  const [inline]

List of all contents (referenced by those nodes that are.

contents)

Definition at line 379 of file indexedOctree.H.

const treeBoundBox& bb (  )  const [inline]

Top bounding box.

Definition at line 385 of file indexedOctree.H.

static bool isContent ( const labelBits  i  )  [inline, static]

Definition at line 398 of file indexedOctree.H.

static bool isEmpty ( const labelBits  i  )  [inline, static]

Definition at line 403 of file indexedOctree.H.

static bool isNode ( const labelBits  i  )  [inline, static]

Definition at line 408 of file indexedOctree.H.

Referenced by indexedOctree< Foam::treeDataTriSurface >::isEmpty().

Here is the caller graph for this function:

static label getContent ( const labelBits  i  )  [inline, static]

Definition at line 413 of file indexedOctree.H.

static label getNode ( const labelBits  i  )  [inline, static]

Definition at line 423 of file indexedOctree.H.

static direction getOctant ( const labelBits  i  )  [inline, static]

Definition at line 433 of file indexedOctree.H.

pointIndexHit findNearest ( const point &  sample,
const scalar  nearestDistSqr 
) const

Calculate nearest point on nearest shape. Returns.

  • bool : any point found nearer than nearestDistSqr
  • label: index in shapes
  • point: actual nearest point found

void findNearest ( const label  nodeI,
const point &  ,
scalar &  nearestDistSqr,
label &  nearestShapeI,
point &  nearestPoint 
) const

Low level: calculate nearest starting from subnode.

pointIndexHit findNearest ( const linePointRef &  ln,
treeBoundBox &  tightest,
point &  linePoint 
) const

Find nearest to line. Returns.

  • bool : any point found?
  • label: index in shapes
  • point: actual nearest point found sets:
  • linePoint : corresponding nearest point on line

pointIndexHit findLine ( const point &  start,
const point &  end 
) const

Find nearest intersection of line between start and end.

pointIndexHit findLineAny ( const point &  start,
const point &  end 
) const

Find any intersection of line between start and end.

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)

labelBits findNode ( const label  nodeI,
const point &   
) const

Find deepest node (as parent+octant) containing point. Starts.

off from starting index in nodes_ (use 0 to start from top) Use getNode, getOctant to extract info.

volumeType getVolumeType ( const point &   )  const

Determine type (inside/outside/mixed) for point. unknown if.

cannot be determined (e.g. non-manifold surface)

static bool intersects ( const point &  bbMin,
const point &  bbMax,
const scalar  nearestDistSqr,
const point &  sample 
) [static]

Helper: does bb intersect a sphere around sample? Or is any.

corner point of bb closer than nearestDistSqr to sample.

void print ( prefixOSstream &  ,
const bool  printContents,
const   label 
) const

Print tree. Either print all indices (printContent = true) or.

just size of contents nodes.

bool write ( Ostream &  os  )  const


Friends And Related Function Documentation

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


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