Standard boundBox with extra functionality for use in octree. More...
Public Types | |
enum | octantBit : direction { RIGHTHALF = 0x1, TOPHALF = 0x2, FRONTHALF = 0x4 } |
enum | faceId { LEFT = 0, RIGHT = 1, BOTTOM = 2, TOP = 3, BACK = 4, FRONT = 5 } |
enum | faceBit : direction { NOFACE = 0, LEFTBIT = 0x1 << LEFT, RIGHTBIT = 0x1 << RIGHT, BOTTOMBIT = 0x1 << BOTTOM, TOPBIT = 0x1 << TOP, BACKBIT = 0x1 << BACK, FRONTBIT = 0x1 << FRONT } |
enum | edgeId { E01 = 0, E13 = 1, E23 = 2, E02 = 3, E45 = 4, E57 = 5, E67 = 6, E46 = 7, E04 = 8, E15 = 9, E37 = 10, E26 = 11 } |
![]() | |
enum | directionBit : direction { XDIR = 0x1, YDIR = 0x2, ZDIR = 0x4 } |
Public Member Functions | |
treeBoundBox () | |
treeBoundBox (const boundBox &bb) | |
treeBoundBox (const point &pt) | |
treeBoundBox (const point &min, const point &max) | |
treeBoundBox (const UList< point > &points) | |
treeBoundBox (const UList< point > &points, const labelUList &indices) | |
template<unsigned N> | |
treeBoundBox (const UList< point > &points, const FixedList< label, N > &indices) | |
treeBoundBox (Istream &is) | |
scalar | typDim () const |
tmp< pointField > | points () const |
point | corner (const direction octant) const |
treeBoundBox | subBbox (const direction octant) const |
treeBoundBox | subBbox (const point &mid, const direction) const |
direction | subOctant (const point &pt) const |
direction | subOctant (const point &pt, bool &onEdge) const |
void | searchOrder (const point &pt, FixedList< direction, 8 > &octantOrder) const |
bool | intersects (const point &overallStart, const vector &overallVec, const point &start, const point &end, point &pt, direction &ptBits) const |
bool | intersects (const point &start, const point &end, point &pt) const |
bool | contains (const vector &dir, const point &) const |
direction | faceBits (const point &pt) const |
direction | posBits (const point &pt) const |
void | calcExtremities (const point &pt, point &nearest, point &furthest) const |
scalar | maxDist (const point &pt) const |
label | distanceCmp (const point &pt, const treeBoundBox &other) const |
treeBoundBox | extend (Random &rndGen, const scalar s) const |
bool | overlaps (const boundBox &bb) const |
bool | overlaps (const point ¢re, const scalar radiusSqr) const |
bool | contains (const point &pt) const |
bool | contains (const boundBox &bb) const |
bool | contains (const UList< point > &points) const |
template<unsigned N> | |
bool | contains (const UList< point > &points, const FixedList< label, N > &indices) const |
template<class IntContainer > | |
bool | contains (const UList< point > &points, const IntContainer &indices) const |
![]() | |
boundBox () | |
boundBox (const point &pt) | |
boundBox (const point &min, const point &max) | |
boundBox (const UList< point > &points, bool doReduce=true) | |
boundBox (const tmp< pointField > &tpoints, bool doReduce=true) | |
boundBox (const UList< point > &points, const labelUList &indices, bool doReduce=true) | |
template<unsigned N> | |
boundBox (const UList< point > &points, const FixedList< label, N > &indices, bool doReduce=true) | |
boundBox (Istream &is) | |
bool | empty () const |
bool | valid () const |
const point & | min () const |
const point & | max () const |
point & | min () |
point & | max () |
point | centre () const |
point | midpoint () const |
vector | span () const |
scalar | mag () const |
scalar | volume () const |
scalar | minDim () const |
scalar | maxDim () const |
scalar | avgDim () const |
label | nDim () const |
tmp< pointField > | points () const |
tmp< pointField > | faceCentres () const |
point | faceCentre (const direction facei) const |
void | clear () |
void | add (const boundBox &bb) |
void | add (const point &pt) |
void | add (const UList< point > &points) |
void | add (const tmp< pointField > &tpoints) |
template<unsigned N> | |
void | add (const FixedList< point, N > &points) |
template<unsigned N> | |
void | add (const UList< point > &points, const FixedList< label, N > &indices) |
template<class IntContainer > | |
void | add (const UList< point > &points, const IntContainer &indices) |
void | inflate (const scalar s) |
void | reduce () |
bool | intersect (const boundBox &bb) |
bool | intersects (const plane &pln) const |
bool | overlaps (const boundBox &bb) const |
bool | overlaps (const point ¢re, const scalar radiusSqr) const |
bool | contains (const point &pt) const |
bool | contains (const boundBox &bb) const |
bool | containsInside (const point &pt) const |
bool | contains (const UList< point > &points) const |
template<unsigned N> | |
bool | contains (const UList< point > &points, const FixedList< label, N > &indices) const |
template<class IntContainer > | |
bool | contains (const UList< point > &points, const IntContainer &indices) const |
bool | containsAny (const UList< point > &points) const |
template<unsigned N> | |
bool | containsAny (const UList< point > &points, const FixedList< label, N > &indices) const |
template<class IntContainer > | |
bool | containsAny (const UList< point > &points, const IntContainer &indices) const |
point | nearest (const point &pt) const |
void | operator+= (const boundBox &bb) |
Static Public Member Functions | |
static direction | subOctant (const point &mid, const point &pt) |
static direction | subOctant (const point &mid, const point &pt, bool &onEdge) |
static direction | subOctant (const point &mid, const vector &dir, const point &pt, bool &onEdge) |
Static Public Attributes | |
static const faceList | faces |
static const edgeList | edges |
![]() | |
static const boundBox | greatBox |
static const boundBox | invertedBox |
static const faceList | faces |
static const FixedList< vector, 6 > | faceNormals |
Friends | |
Istream & | operator>> (Istream &is, treeBoundBox &bb) |
Ostream & | operator<< (Ostream &os, const treeBoundBox &bb) |
Standard boundBox with extra functionality for use in octree.
Numbering of corner points is according to octant numbering.
On the back plane (z=0):
Y ^ | +--------+ |2 3| | | | | | | |0 1| +--------+->X
For the front plane add 4 to the point labels.
Definition at line 82 of file treeBoundBox.H.
Enumerator | |
---|---|
RIGHTHALF | 1: positive x-direction |
TOPHALF | 2: positive y-direction |
FRONTHALF | 4: positive z-direction |
Definition at line 92 of file treeBoundBox.H.
enum faceId |
Enumerator | |
---|---|
LEFT | 0: x-min, left |
RIGHT | 1: x-max, right |
BOTTOM | 2: y-min, bottom |
TOP | 3: y-max, top |
BACK | 4: z-min, back |
FRONT | 5: z-max, front |
Definition at line 101 of file treeBoundBox.H.
Enumerator | |
---|---|
NOFACE | |
LEFTBIT | 1: x-min, left |
RIGHTBIT | 2: x-max, right |
BOTTOMBIT | 4: y-min, bottom |
TOPBIT | 8: y-max, top |
BACKBIT | 16: z-min, back |
FRONTBIT | 32: z-max, front |
Definition at line 112 of file treeBoundBox.H.
enum edgeId |
Enumerator | |
---|---|
E01 | |
E13 | |
E23 | |
E02 | |
E45 | |
E57 | |
E67 | |
E46 | |
E04 | |
E15 | |
E37 | |
E26 |
Definition at line 125 of file treeBoundBox.H.
|
inline |
Definition at line 27 of file treeBoundBoxI.H.
|
inlineexplicit |
Definition at line 33 of file treeBoundBoxI.H.
|
inlineexplicit |
Definition at line 39 of file treeBoundBoxI.H.
|
inline |
Definition at line 45 of file treeBoundBoxI.H.
|
explicit |
Definition at line 55 of file treeBoundBox.C.
References Foam::nl, treeBoundBox::points(), and WarningInFunction.
treeBoundBox | ( | const UList< point > & | points, |
const labelUList & | indices | ||
) |
Definition at line 68 of file treeBoundBox.C.
References UList::empty(), Foam::nl, points, and WarningInFunction.
treeBoundBox | ( | const UList< point > & | points, |
const FixedList< label, N > & | indices | ||
) |
Definition at line 28 of file treeBoundBoxTemplates.C.
References Foam::nl, points, and WarningInFunction.
|
inline |
Definition at line 51 of file treeBoundBoxI.H.
|
inline |
Definition at line 59 of file treeBoundBoxI.H.
Foam::tmp< Foam::pointField > points | ( | ) | const |
Definition at line 85 of file treeBoundBox.C.
References forAll, and tmp::New().
Referenced by searchableBox::boundingSpheres(), searchableBox::coordinates(), triangleFuncs::intersectBb(), searchableBox::points(), treeBoundBox::treeBoundBox(), OBJstream::write(), box::writeBoxes(), AABBTree::writeOBJ(), and Foam::meshTools::writeOBJ().
|
inline |
Definition at line 65 of file treeBoundBoxI.H.
References Foam::max(), Foam::min(), x, and y.
Foam::treeBoundBox subBbox | ( | const direction | octant | ) | const |
Definition at line 99 of file treeBoundBox.C.
Referenced by dynamicIndexedOctree::insertIndex(), dynamicIndexedOctree::print(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::print(), box::refineBox(), and dynamicIndexedOctree::removeIndex().
Foam::treeBoundBox subBbox | ( | const point & | mid, |
const direction | octant | ||
) | const |
Definition at line 106 of file treeBoundBox.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, treeBoundBox::FRONTHALF, boundBox::max(), boundBox::min(), treeBoundBox::RIGHTHALF, treeBoundBox::TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
inline |
Definition at line 77 of file treeBoundBoxI.H.
Referenced by dynamicIndexedOctree::findNode().
|
inlinestatic |
Definition at line 86 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, treeBoundBox::RIGHTHALF, treeBoundBox::TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
inline |
Definition at line 115 of file treeBoundBoxI.H.
|
inlinestatic |
Definition at line 127 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, treeBoundBox::RIGHTHALF, treeBoundBox::TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
inlinestatic |
Definition at line 172 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, treeBoundBox::RIGHTHALF, treeBoundBox::TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Definition at line 228 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, Foam::max(), Foam::min(), treeBoundBox::RIGHTHALF, treeBoundBox::TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
bool intersects | ( | const point & | overallStart, |
const vector & | overallVec, | ||
const point & | start, | ||
const point & | end, | ||
point & | pt, | ||
direction & | ptBits | ||
) | const |
Definition at line 155 of file treeBoundBox.C.
References stdFoam::end(), Foam::mag(), Foam::max(), Foam::min(), s, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findLine(), triangleFuncs::intersectBb(), searchableRotatedBox::overlaps(), treeDataEdge::overlaps(), and streamLineBase::trimToBox().
Definition at line 302 of file treeBoundBox.C.
References stdFoam::end().
Definition at line 313 of file treeBoundBox.C.
References Foam::max(), Foam::min(), and VectorSpace< Vector< scalar >, scalar, 3 >::nComponents.
Referenced by waveMethod::calculate(), surfaceFeatures::deleteBox(), dynamicTreeDataPoint::findNearest(), dynamicIndexedOctree::findNode(), dynamicTreeDataPoint::overlaps(), treeDataPoint::overlaps(), AABBTree::pointInside(), streamLineBase::trimToBox(), and propellerInfo::updateSampleDiskCells().
Foam::direction faceBits | ( | const point & | pt | ) | const |
Definition at line 351 of file treeBoundBox.C.
References Foam::max(), Foam::min(), x, Vector< Cmpt >::x(), y, Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findLine().
Foam::direction posBits | ( | const point & | pt | ) | const |
Definition at line 386 of file treeBoundBox.C.
References Foam::max(), Foam::min(), x, Vector< Cmpt >::x(), y, Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by treeDataPrimitivePatch< PatchType >::findIntersection(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findLine(), treeDataCell::findIntersectOp::operator()(), and treeDataFace::findIntersectOp::operator()().
Definition at line 422 of file treeBoundBox.C.
References Foam::mag(), Foam::max(), Foam::min(), and VectorSpace< Vector< scalar >, scalar, 3 >::nComponents.
Referenced by treeBoundBox::distanceCmp().
Foam::scalar maxDist | ( | const point & | pt | ) | const |
Definition at line 448 of file treeBoundBox.C.
References Foam::mag().
Foam::label distanceCmp | ( | const point & | pt, |
const treeBoundBox & | other | ||
) | const |
Definition at line 458 of file treeBoundBox.C.
References treeBoundBox::calcExtremities(), Foam::sqr(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
inline |
Definition at line 318 of file treeBoundBoxI.H.
References Foam::cmptMultiply(), Foam::mag(), boundBox::max(), Foam::max(), boundBox::min(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, rndGen, s, Random::sample01(), and boundBox::span().
Referenced by polyMesh::cellTree(), meshRefinement::distribute(), triSurfaceMesh::edgeTree(), patchProbes::findElements(), mappedPatchBase::findLocalSamples(), refinementFeatures::regionEdgeTrees(), triSurfaceSearch::tree(), and triSurfaceRegionSearch::treeByRegion().
|
inline |
Definition at line 214 of file boundBoxI.H.
Referenced by trackingInverseDistance::markDonors(), inverseDistance::markDonors(), trackingInverseDistance::markPatchesAsHoles(), inverseDistance::markPatchesAsHoles(), AABBTree::overlaps(), treeDataFace::overlaps(), treeDataCell::overlaps(), treeDataPrimitivePatch< PatchType >::overlaps(), and box::refineBox().
|
inline |
Definition at line 226 of file boundBoxI.H.
|
inline |
Definition at line 264 of file boundBoxI.H.
|
inline |
Definition at line 275 of file boundBoxI.H.
bool contains |
Definition at line 223 of file boundBox.C.
|
inline |
Definition at line 113 of file boundBoxTemplates.C.
|
inline |
Definition at line 142 of file boundBoxTemplates.C.
|
friend |
|
friend |
|
static |
Definition at line 147 of file treeBoundBox.H.
Referenced by searchableBox::boundingSpheres(), searchableBox::coordinates(), searchableRotatedBox::overlaps(), OBJstream::write(), box::writeBoxes(), and AABBTree::writeOBJ().
|
static |
Definition at line 150 of file treeBoundBox.H.
Referenced by distributedTriSurfaceMesh::distribute(), triangleFuncs::intersectBb(), searchableRotatedBox::overlaps(), OBJstream::write(), and AABBTree::writeOBJ().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.