OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

indexedOctree< Type > Class Template Reference

Non-pointer based hierarchical recursive searching. More...

Inheritance diagram for indexedOctree< Type >:
Collaboration diagram for indexedOctree< Type >:

List of all members.


Classes

class  node

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.
autoPtr< indexedOctree< Type > > clone () const
 Clone.
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 scalar & perturbTol ()
 Get the perturbation tolerance.
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 volumeType getSide (const vector &outsideNormal, const vector &vec)
 Helper function to return the side. Returns outside if.
static bool overlaps (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 > &)

Detailed Description

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

Non-pointer based hierarchical recursive searching.

Source files

Definition at line 64 of file indexedOctree.H.


Member Enumeration Documentation

enum volumeType

volume types

Enumerator:
UNKNOWN 
MIXED 
INSIDE 
OUTSIDE 

Definition at line 73 of file indexedOctree.H.


Constructor & Destructor Documentation

indexedOctree ( const Type &  shapes  )  [inline]

Construct null.

Definition at line 2136 of file indexedOctree.C.

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

Construct from components.

Definition at line 2147 of file indexedOctree.C.

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

Construct from shapes.

Definition at line 2162 of file indexedOctree.C.

indexedOctree ( const Type &  shapes,
Istream &  is 
) [inline]

Construct from Istream.

Definition at line 2314 of file indexedOctree.C.


Member Function Documentation

Foam::scalar & perturbTol (  )  [inline, static]

Get the perturbation tolerance.

Definition at line 2329 of file indexedOctree.C.

autoPtr<indexedOctree<Type> > clone (  )  const [inline]

Clone.

Definition at line 426 of file indexedOctree.H.

const Type& shapes (  )  const [inline]

Reference to shape.

Definition at line 439 of file indexedOctree.H.

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

List of all nodes.

Definition at line 445 of file indexedOctree.H.

const labelListList& contents (  )  const [inline]

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

contents)

Definition at line 454 of file indexedOctree.H.

const treeBoundBox& bb (  )  const [inline]

Top bounding box.

Definition at line 460 of file indexedOctree.H.

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

Definition at line 473 of file indexedOctree.H.

Referenced by indexedOctree< Type >::findNearest(), and indexedOctree< treeDataTriSurface >::isContent().

Here is the caller graph for this function:

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

Definition at line 478 of file indexedOctree.H.

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

Definition at line 483 of file indexedOctree.H.

Referenced by indexedOctree< Type >::findNearest(), and indexedOctree< treeDataTriSurface >::isNode().

Here is the caller graph for this function:

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

Definition at line 488 of file indexedOctree.H.

Referenced by indexedOctree< Type >::findNearest().

Here is the caller graph for this function:

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

Definition at line 498 of file indexedOctree.H.

Referenced by indexedOctree< Type >::findNearest().

Here is the caller graph for this function:

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

Definition at line 508 of file indexedOctree.H.

Foam::pointIndexHit findNearest ( const point &  sample,
const scalar  nearestDistSqr 
) const [inline]

Calculate nearest point on nearest shape. Returns.

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

Definition at line 2337 of file indexedOctree.C.

void findNearest ( const label  nodeI,
const point &  sample,
scalar &  nearestDistSqr,
label &  nearestShapeI,
point &  nearestPoint 
) const [inline]

Low level: calculate nearest starting from subnode.

Definition at line 540 of file indexedOctree.C.

References node::bb_, indexedOctree< Type >::getContent(), indexedOctree< Type >::getNode(), indexedOctree< Type >::isContent(), indexedOctree< Type >::isNode(), boundBox::max(), boundBox::min(), treeBoundBox::searchOrder(), and node::subNodes_.

Here is the call graph for this function:

Foam::pointIndexHit findNearest ( const linePointRef &  ln,
treeBoundBox &  tightest,
point &  linePoint 
) const [inline]

Find nearest to line. Returns.

Definition at line 2369 of file indexedOctree.C.

Foam::pointIndexHit findLine ( const point &  start,
const point &  end 
) const [inline]

Find nearest intersection of line between start and end.

Definition at line 2403 of file indexedOctree.C.

Foam::pointIndexHit findLineAny ( const point &  start,
const point &  end 
) const [inline]

Find any intersection of line between start and end.

Definition at line 2415 of file indexedOctree.C.

Foam::labelList findBox ( const boundBox &  bb  )  const [inline]

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

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

Definition at line 2426 of file indexedOctree.C.

Foam::labelBits findNode ( const label  nodeI,
const point &  sample 
) const [inline]

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.

Definition at line 2445 of file indexedOctree.C.

Foam::indexedOctree< Type >::volumeType getVolumeType ( const point &  sample  )  const [inline]

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

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

Definition at line 2494 of file indexedOctree.C.

Foam::indexedOctree< Type >::volumeType getSide ( const vector &  outsideNormal,
const vector &  vec 
) [inline, static]

Helper function to return the side. Returns outside if.

outsideNormal&vec >= 0, inside otherwise

Definition at line 516 of file indexedOctree.C.

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

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

corner point of bb closer than nearestDistSqr to sample.

Definition at line 35 of file indexedOctree.C.

References Foam::mag().

Here is the call graph for this function:

void print ( prefixOSstream &  os,
const bool  printContents,
const label  nodeI 
) const [inline]

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

just size of contents nodes.

Definition at line 2564 of file indexedOctree.C.

bool write ( Ostream &  os  )  const [inline]

Definition at line 2627 of file indexedOctree.C.


Friends And Related Function Documentation

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


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