Non-pointer based hierarchical recursive searching. More...
#include <meshTools/indexedOctree.H>
Non-pointer based hierarchical recursive searching.
Definition at line 69 of file indexedOctree.H.
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 treeBoundBox &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 > &) |
enum volumeType |
volume types
Definition at line 78 of file indexedOctree.H.
indexedOctree | ( | const Type & | shapes | ) |
Construct null.
Definition at line 2144 of file indexedOctree.C.
indexedOctree | ( | const Type & | shapes, |
const List< node > & | nodes, | ||
const labelListList & | contents | ||
) |
Construct from components.
Definition at line 2155 of file indexedOctree.C.
indexedOctree | ( | const Type & | shapes, |
const treeBoundBox & | bb, | ||
const label | maxLevels, | ||
const scalar | maxLeafRatio, | ||
const scalar | maxDuplicity | ||
) |
Construct from shapes.
Definition at line 2170 of file indexedOctree.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clear(), Foam::divide(), Foam::endl(), forAll, Foam::identity(), Foam::nl, Foam::Pout, DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), and List< T >::size().
indexedOctree | ( | const Type & | shapes, |
Istream & | is | ||
) |
Construct from Istream.
Definition at line 2322 of file indexedOctree.C.
|
static |
Get the perturbation tolerance.
Definition at line 2337 of file indexedOctree.C.
Referenced by triSurfaceMesh::findLine(), triSurfaceMesh::findLineAll(), triSurfaceMesh::findLineAny(), triSurfaceMesh::findNearest(), treeDataTriSurface::getVolumeType(), triSurfaceMesh::getVolumeType(), and triSurfaceMesh::tree().
|
inline |
Clone.
Definition at line 411 of file indexedOctree.H.
|
inline |
Reference to shape.
Definition at line 424 of file indexedOctree.H.
Referenced by patchProbes::findElements(), and meshSearch::findNearestBoundaryFace().
List of all nodes.
Definition at line 430 of file indexedOctree.H.
|
inline |
List of all contents (referenced by those nodes that are.
contents)
Definition at line 437 of file indexedOctree.H.
|
inline |
Top bounding box.
Definition at line 443 of file indexedOctree.H.
Referenced by patchProbes::findElements(), meshSearch::findNearestBoundaryFace(), and treeDataTriSurface::getVolumeType().
|
inlinestatic |
Definition at line 456 of file indexedOctree.H.
Referenced by indexedOctree< treeDataTriSurface >::getContent().
|
inlinestatic |
Definition at line 461 of file indexedOctree.H.
|
inlinestatic |
Definition at line 466 of file indexedOctree.H.
Referenced by indexedOctree< treeDataTriSurface >::getNode().
|
inlinestatic |
Definition at line 471 of file indexedOctree.H.
|
inlinestatic |
Definition at line 481 of file indexedOctree.H.
Definition at line 491 of file indexedOctree.H.
Foam::pointIndexHit findNearest | ( | const point & | sample, |
const scalar | nearestDistSqr | ||
) | const |
Calculate nearest point on nearest shape. Returns.
label: index in shapes
Definition at line 2345 of file indexedOctree.C.
References Vector< scalar >::zero.
void findNearest | ( | const label | nodeI, |
const point & | sample, | ||
scalar & | nearestDistSqr, | ||
label & | nearestShapeI, | ||
point & | nearestPoint | ||
) | const |
Low level: calculate nearest starting from subnode.
Definition at line 546 of file indexedOctree.C.
References indexedOctree< Type >::node::bb_, boundBox::max(), boundBox::min(), treeBoundBox::searchOrder(), and indexedOctree< Type >::node::subNodes_.
Foam::pointIndexHit findNearest | ( | const linePointRef & | ln, |
treeBoundBox & | tightest, | ||
point & | linePoint | ||
) | const |
Find nearest to line. Returns.
label: index in shapes
Definition at line 2377 of file indexedOctree.C.
References Vector< scalar >::zero.
Foam::pointIndexHit findLine | ( | const point & | start, |
const point & | end | ||
) | const |
Find nearest intersection of line between start and end.
Definition at line 2411 of file indexedOctree.C.
Foam::pointIndexHit findLineAny | ( | const point & | start, |
const point & | end | ||
) | const |
Find any intersection of line between start and end.
Definition at line 2423 of file indexedOctree.C.
Referenced by triSurfaceMesh::findLineAny().
Foam::labelList findBox | ( | const treeBoundBox & | bb | ) | const |
Find (in no particular order) indices of all shapes inside or.
overlapping bounding box (i.e. all shapes not outside box)
Definition at line 2434 of file indexedOctree.C.
Foam::labelBits findNode | ( | const label | nodeI, |
const point & | sample | ||
) | 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.
Definition at line 2453 of file indexedOctree.C.
References Foam::abort(), indexedOctree< Type >::node::bb_, treeBoundBox::contains(), Foam::FatalError, FatalErrorIn, indexedOctree< Type >::node::subNodes_, and treeBoundBox::subOctant().
Foam::indexedOctree< Type >::volumeType getVolumeType | ( | const point & | sample | ) | const |
Determine type (inside/outside/mixed) for point. unknown if.
cannot be determined (e.g. non-manifold surface)
Definition at line 2502 of file indexedOctree.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, Foam::Pout, and Foam::type().
|
static |
Helper function to return the side. Returns outside if.
outsideNormal&vec >= 0, inside otherwise
Definition at line 522 of file indexedOctree.C.
Referenced by treeDataFace::getVolumeType().
|
static |
Helper: does bb intersect a sphere around sample? Or is any.
corner point of bb closer than nearestDistSqr to sample.
Definition at line 43 of file indexedOctree.C.
References Foam::mag().
void print | ( | prefixOSstream & | os, |
const bool | printContents, | ||
const label | nodeI | ||
) | const |
Print tree. Either print all indices (printContent = true) or.
just size of contents nodes.
Definition at line 2572 of file indexedOctree.C.
References indexedOctree< Type >::node::bb_, Foam::endl(), forAll, Foam::nl, indexedOctree< Type >::node::parent_, prefixOSstream::prefix(), List< T >::size(), FixedList< T, Size >::size(), treeBoundBox::subBbox(), and indexedOctree< Type >::node::subNodes_.
bool write | ( | Ostream & | os | ) | const |
Definition at line 2635 of file indexedOctree.C.
References IOstream::good().
|
friend |