Searching on bounding box. More...
#include <meshTools/searchableBox.H>
Searching on bounding box.
Definition at line 52 of file searchableBox.H.
Public Member Functions | |
TypeName ("searchableBox") | |
Runtime type information.
| |
searchableBox (const IOobject &io, const treeBoundBox &bb) | |
Construct from components.
| |
searchableBox (const IOobject &io, const dictionary &dict) | |
Construct from dictionary (used by searchableSurface)
| |
virtual | ~searchableBox () |
virtual const wordList & | regions () const |
Names of regions.
| |
virtual bool | hasVolumeType () const |
Whether supports volume type below.
| |
virtual label | size () const |
Range of local indices that can be returned.
| |
virtual pointField | coordinates () const |
Get representative set of element coordinates.
| |
pointIndexHit | findNearest (const point &sample, const scalar nearestDistSqr) const |
Calculate nearest point on surface. Returns.
| |
pointIndexHit | findNearestOnEdge (const point &sample, const scalar nearestDistSqr) const |
Calculate nearest point on edge. Returns.
| |
pointIndexHit | findNearest (const linePointRef &ln, treeBoundBox &tightest, point &linePoint) const |
Find nearest to segment. 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.
| |
virtual void | findNearest (const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const |
virtual void | findLine (const pointField &start, const pointField &end, List< pointIndexHit > &) const |
Find first intersection on segment from start to end.
| |
virtual void | findLineAny (const pointField &start, const pointField &end, List< pointIndexHit > &) const |
Return any intersection on segment from start to end.
| |
virtual void | findLineAll (const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const |
Get all intersections in order from start to end.
| |
virtual void | getRegion (const List< pointIndexHit > &, labelList ®ion) const |
From a set of points and indices get the region.
| |
virtual void | getNormal (const List< pointIndexHit > &, vectorField &normal) const |
From a set of points and indices get the normal.
| |
virtual void | getVolumeType (const pointField &, List< volumeType > &) const |
Determine type (inside/outside/mixed) for point. unknown if.
| |
bool | writeData (Ostream &) const |
Pure virtual writaData function.
|
searchableBox | ( | const IOobject & | io, |
const treeBoundBox & | bb | ||
) |
Construct from components.
Definition at line 165 of file searchableBox.C.
References Foam::exit(), Foam::FatalError, and FatalErrorIn.
searchableBox | ( | const IOobject & | io, |
const dictionary & | dict | ||
) |
Construct from dictionary (used by searchableSurface)
Definition at line 189 of file searchableBox.C.
References Foam::exit(), Foam::FatalError, and FatalErrorIn.
~searchableBox | ( | ) | [virtual]
|
Definition at line 214 of file searchableBox.C.
TypeName | ( | "searchableBox" | ) |
Runtime type information.
const Foam::wordList & regions | ( | ) | const [virtual]
|
Names of regions.
Implements searchableSurface.
Definition at line 220 of file searchableBox.C.
References List< T >::setSize().
virtual bool hasVolumeType | ( | ) | const [inline, virtual]
|
Whether supports volume type below.
Implements searchableSurface.
Definition at line 118 of file searchableBox.H.
virtual label size | ( | ) | const [inline, virtual]
|
Range of local indices that can be returned.
Implements searchableSurface.
Definition at line 124 of file searchableBox.H.
Foam::pointField coordinates | ( | ) | const [virtual]
|
Get representative set of element coordinates.
Usually the element centres (should be of length size()).
Implements searchableSurface.
Definition at line 231 of file searchableBox.C.
References treeBoundBox::faces, forAll, and treeBoundBox::points().
Foam::pointIndexHit findNearest | ( | const point & | sample, |
const scalar | nearestDistSqr | ||
) | const |
Calculate nearest point on surface. Returns.
label: relevant index in surface (=face 0..5)
Definition at line 247 of file searchableBox.C.
Foam::pointIndexHit findNearestOnEdge | ( | const point & | sample, |
const scalar | nearestDistSqr | ||
) | const |
Calculate nearest point on edge. Returns.
label: relevant index in surface(=?)
Definition at line 257 of file searchableBox.C.
References Foam::cmptMag(), dist, SortableList< T >::indices(), Foam::magSqr(), Foam::max(), Foam::min(), VectorSpace< Vector< Cmpt >, Cmpt, 3 >::nComponents, PointIndexHit< Point >::rawPoint(), PointIndexHit< Point >::setIndex(), PointIndexHit< Point >::setMiss(), and SortableList< T >::sort().
Foam::pointIndexHit findNearest | ( | const linePointRef & | ln, |
treeBoundBox & | tightest, | ||
point & | linePoint | ||
) | const |
Find nearest to segment. Returns.
label: relevant index in shapes (=face 0..5)
Definition at line 327 of file searchableBox.C.
References notImplemented.
Foam::pointIndexHit findLine | ( | const point & | start, |
const point & | end | ||
) | const |
Find nearest intersection of line between start and end.
Definition at line 343 of file searchableBox.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, PointIndexHit< Point >::index(), Foam::max(), Foam::min(), VectorSpace< Vector< Cmpt >, Cmpt, 3 >::nComponents, PointIndexHit< Point >::rawPoint(), PointIndexHit< Point >::setHit(), and PointIndexHit< Point >::setIndex().
Foam::pointIndexHit findLineAny | ( | const point & | start, |
const point & | end | ||
) | const |
Find any intersection of line between start and end.
Definition at line 406 of file searchableBox.C.
void findNearest | ( | const pointField & | sample, |
const scalarField & | nearestDistSqr, | ||
List< pointIndexHit > & | info | ||
) | const [virtual]
|
Implements searchableSurface.
Definition at line 416 of file searchableBox.C.
References forAll, List< T >::setSize(), and List< T >::size().
void findLine | ( | const pointField & | start, |
const pointField & | end, | ||
List< pointIndexHit > & | |||
) | const [virtual]
|
Find first intersection on segment from start to end.
Note: searchableSurfacesQueries expects no intersection to be found if start==end. Is problem?
Implements searchableSurface.
Definition at line 434 of file searchableBox.C.
References forAll, List< T >::setSize(), and List< T >::size().
void findLineAny | ( | const pointField & | start, |
const pointField & | end, | ||
List< pointIndexHit > & | |||
) | const [virtual]
|
Return any intersection on segment from start to end.
Implements searchableSurface.
Definition at line 450 of file searchableBox.C.
References forAll, List< T >::setSize(), and List< T >::size().
void findLineAll | ( | const pointField & | start, |
const pointField & | end, | ||
List< List< pointIndexHit > > & | info | ||
) | const [virtual]
|
Get all intersections in order from start to end.
Implements searchableSurface.
Definition at line 466 of file searchableBox.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), List< T >::clear(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clear(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::magSqr(), List< T >::setSize(), List< T >::size(), Foam::sqrt(), and List< T >::transfer().
void getRegion | ( | const List< pointIndexHit > & | info, |
labelList & | region | ||
) | const [virtual]
|
From a set of points and indices get the region.
Implements searchableSurface.
Definition at line 534 of file searchableBox.C.
References List< T >::setSize(), and List< T >::size().
void getNormal | ( | const List< pointIndexHit > & | info, |
vectorField & | normal | ||
) | const [virtual]
|
From a set of points and indices get the normal.
Implements searchableSurface.
Definition at line 545 of file searchableBox.C.
References treeBoundBox::faceNormals, forAll, List< T >::setSize(), List< T >::size(), and Vector< Cmpt >::zero.
void getVolumeType | ( | const pointField & | points, |
List< volumeType > & | volType | ||
) | const [virtual]
|
Determine type (inside/outside/mixed) for point. unknown if.
cannot be determined (e.g. non-manifold surface)
Implements searchableSurface.
Definition at line 568 of file searchableBox.C.
References forAll, Foam::max(), Foam::min(), VectorSpace< Vector< Cmpt >, Cmpt, 3 >::nComponents, List< T >::setSize(), and List< T >::size().
bool writeData | ( | Ostream & | ) | const [inline, virtual]
|
Pure virtual writaData function.
Must be defined in derived types
Implements regIOobject.
Definition at line 240 of file searchableBox.H.
References notImplemented.