Standard boundBox with extra functionality for use in octree. More...
Public Types | |
enum | octantBit : direction { RIGHTHALF = 1, TOPHALF = 2, FRONTHALF = 4 } |
Bits used for octant/point directional encoding. More... | |
enum | faceId : direction { LEFT = 0, RIGHT = 1, BOTTOM = 2, TOP = 3, BACK = 4, FRONT = 5 } |
Face codes. Identical order and meaning as per hex cellmodel and boundBox, but have a different point ordering. More... | |
enum | faceBit : direction { NOFACE = 0, LEFTBIT = (1 << LEFT), RIGHTBIT = (1 << RIGHT), BOTTOMBIT = (1 << BOTTOM), TOPBIT = (1 << TOP), BACKBIT = (1 << BACK), FRONTBIT = (1 << FRONT) } |
Bits used for face encoding. More... | |
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 } |
Edges codes. More... | |
Public Types inherited from boundBox | |
enum | directionBit : direction { XDIR = 1, YDIR = 2, ZDIR = 4 } |
Bits used for (x/y/z) directional encoding. More... | |
Public Member Functions | |
treeBoundBox ()=default | |
Default construct: an inverted bounding box. More... | |
treeBoundBox (const treeBoundBox &)=default | |
Copy construct. More... | |
treeBoundBox & | operator= (const treeBoundBox &)=default |
Copy assignment. More... | |
treeBoundBox (const boundBox &bb) | |
Copy construct from a boundBox. More... | |
void | operator= (const boundBox &bb) |
Copy assignment from a boundBox. More... | |
treeBoundBox (const Foam::zero_one) | |
Construct a 0/1 unit bounding box. More... | |
treeBoundBox (const point &p) | |
Construct a bounding box containing a single initial point. More... | |
treeBoundBox (const point &min, const point &max) | |
Construct from bound box min/max points. More... | |
treeBoundBox (const Pair< point > &bb) | |
Construct from bound box min/max points. More... | |
treeBoundBox (const UList< point > &points) | |
Construct as the bounding box of the given pointField. More... | |
treeBoundBox (const UList< point > &points, const labelUList &indices) | |
Construct as subset of points. More... | |
template<unsigned N> | |
treeBoundBox (const UList< point > &points, const FixedList< label, N > &indices) | |
Construct as subset of points. More... | |
treeBoundBox (Istream &is) | |
Construct from Istream. More... | |
tmp< pointField > | points () const |
Vertex coordinates. In octant coding. More... | |
point | corner (const direction octant) const |
Corner point of given octant. More... | |
treeBoundBox | subBbox (const direction octant) const |
Sub-box of given octant. Midpoint calculated. More... | |
treeBoundBox | subBbox (const point &mid, const direction) const |
Sub-box given by octant number. Midpoint provided. More... | |
treeBoundBox | subHalf (const direction whichFace) const |
Sub-box half for given face. More... | |
treeBoundBox | subHalf (const scalar mid, const direction whichFace) const |
Sub-box half for given face with prescribed mid point value. Eg, subHalf(scalar, LEFT) More... | |
direction | subOctant (const point &pt) const |
Returns octant number given point and the calculated midpoint. More... | |
direction | subOctant (const point &pt, bool &onEdge) const |
Returns octant number given point and the calculated midpoint. More... | |
void | searchOrder (const point &pt, FixedList< direction, 8 > &octantOrder) const |
Calculates optimal order to look for nearest to point. More... | |
FixedList< direction, 8 > | searchOrder (const point &pt) const |
Return optimal search order to look for nearest to point. More... | |
bool | subOverlaps (const direction octant, const boundBox &bb) const |
Does sub-octant overlap/touch boundingBox? More... | |
bool | subOverlaps (const direction octant, const point ¢re, const scalar radiusSqr) const |
Does sub-octant overlap boundingSphere (centre + sqr(radius))? More... | |
bool | intersects (const point &overallStart, const vector &overallVec, const point &start, const point &end, point &pt, direction &ptBits) const |
Intersects segment; set point to intersection position and face,. More... | |
bool | intersects (const point &start, const point &end, point &pt) const |
Like above but does not return faces point is on. More... | |
bool | intersects (const linePointRef &ln, point &pt) const |
Like above but does not return faces point is on. More... | |
bool | contains (const vector &dir, const point &) const |
Contains point (inside or on edge) and moving in direction. More... | |
direction | faceBits (const point &pt) const |
Code position of point on bounding box faces. More... | |
direction | posBits (const point &pt) const |
Position of point relative to bounding box. More... | |
void | calcExtremities (const point &pt, point &nearest, point &furthest) const |
Calculate nearest and furthest (to point) vertex coords of. More... | |
scalar | maxDist (const point &pt) const |
Returns distance point to furthest away corner. More... | |
label | distanceCmp (const point &pt, const treeBoundBox &other) const |
Compare distance to point with other bounding box. More... | |
treeBoundBox | extend (Random &rndGen, const scalar s) const |
Return slightly wider bounding box. More... | |
treeBoundBox | extend (Random &rndGen, const scalar s, const scalar delta) const |
As per two parameter version but with additional grow() by given amount in each dimension. More... | |
scalar | typDim () const |
Typical dimension length,height,width. Identical to avgDim() More... | |
bool | overlaps (const boundBox &bb) const |
Overlaps with other bounding box, sphere etc? More... | |
bool | overlaps (const point ¢re, const scalar radiusSqr) const |
Overlaps with other bounding box, sphere etc? More... | |
bool | intersects (const plane &pln) const |
intersects other bounding box, sphere etc? More... | |
bool | intersects (const triPointRef &tri) const |
intersects other bounding box, sphere etc? More... | |
bool | contains (const point &pt) const |
Contains point or other bounding box? More... | |
bool | contains (const boundBox &bb) const |
Contains point or other bounding box? More... | |
bool | contains (const UList< point > &points) const |
Contains point or other bounding box? More... | |
template<unsigned N> | |
bool | contains (const UList< point > &points, const FixedList< label, N > &indices) const |
Contains point or other bounding box? More... | |
template<class IntContainer > | |
bool | contains (const UList< point > &points, const IntContainer &indices) const |
Contains point or other bounding box? More... | |
Public Member Functions inherited from boundBox | |
boundBox () | |
Default construct: an inverted bounding box. More... | |
boundBox (const boundBox &)=default | |
Copy construct. More... | |
boundBox & | operator= (const boundBox &)=default |
Copy assignment. More... | |
boundBox (const boundBox &bb, bool doReduce) | |
Copy construct with specified global reduction. More... | |
boundBox (const point &p) | |
Construct a bounding box containing a single initial point. More... | |
boundBox (const Foam::zero_one) | |
Construct a 0/1 unit bounding box. More... | |
boundBox (const point &min, const point &max) | |
Construct from bound box min/max points. More... | |
boundBox (const Pair< point > &bb) | |
Construct from bound box min/max points. More... | |
boundBox (const UList< point > &points, bool doReduce=true) | |
Construct as the bounding box of the given points. More... | |
boundBox (const tmp< pointField > &tpoints, bool doReduce=true) | |
Construct as the bounding box of the given temporary pointField. More... | |
boundBox (const UList< point > &points, const labelUList &indices, bool doReduce=true) | |
Construct bounding box as an indirect subset of the points. More... | |
template<unsigned N> | |
boundBox (const UList< point > &points, const FixedList< label, N > &indices, bool doReduce=true) | |
Construct bounding box as an indirect subset of the points. More... | |
boundBox (Istream &is) | |
Construct from Istream. More... | |
bool | empty () const |
Bounding box is inverted, contains no points. More... | |
bool | good () const |
Bounding box is non-inverted. More... | |
bool | valid () const |
Bounding box is non-inverted - same as good(). More... | |
const point & | min () const noexcept |
Minimum describing the bounding box. More... | |
const point & | max () const noexcept |
Maximum describing the bounding box. More... | |
point & | min () noexcept |
Minimum describing the bounding box, non-const access. More... | |
point & | max () noexcept |
Maximum describing the bounding box, non-const access. More... | |
point | centre () const |
The centre (midpoint) of the bounding box. More... | |
vector | span () const |
The bounding box span (from minimum to maximum) More... | |
scalar | mag () const |
The magnitude/length of the bounding box diagonal. More... | |
scalar | magSqr () const |
The magnitude/length squared of bounding box diagonal. More... | |
scalar | volume () const |
The volume of the bound box. More... | |
scalar | minDim () const |
Smallest length/height/width dimension. More... | |
scalar | maxDim () const |
Largest length/height/width dimension. More... | |
scalar | avgDim () const |
Average length/height/width dimension. More... | |
direction | minDir () const |
Direction (X/Y/Z) of the smallest span (for empty box: 0) More... | |
direction | maxDir () const |
Direction (X/Y/Z) of the largest span (for empty box: 0) More... | |
int | nDim () const |
Count the number of positive, non-zero dimensions. More... | |
template<direction CornerNumber> | |
point | hexCorner () const |
Return corner point [0..7] corresponding to a 'hex' cell. More... | |
tmp< pointField > | hexCorners () const |
Corner points in an order corresponding to a 'hex' cell. More... | |
tmp< pointField > | points () const |
Corner points in an order corresponding to a 'hex' cell. More... | |
tmp< pointField > | faceCentres () const |
Face midpoints. More... | |
point | faceCentre (const direction facei) const |
Face centre of given face index. More... | |
void | reset () |
Reset to an inverted box. More... | |
void | reset (const Foam::zero_one) |
Reset to a 0/1 unit bounding box. More... | |
void | reset (const point &pt) |
Reset min/max to be identical to the specified point. More... | |
void | reset (const point &min, const point &max) |
Reset min/max to specified values. More... | |
void | clear () |
Same as reset() - reset to an inverted box. More... | |
void | add (const boundBox &bb) |
Extend to include the second box. More... | |
void | add (const point &pt) |
Extend to include the point. More... | |
void | add (const point &pt0, const point &pt1) |
Extend to include two additional points. More... | |
void | add (const Pair< point > &points) |
Extend to include two additional points. More... | |
void | add (const UList< point > &points) |
Extend to include the points. More... | |
void | add (const tmp< pointField > &tpoints) |
Extend to include the points from the temporary point field. More... | |
template<unsigned N> | |
void | add (const FixedList< point, N > &points) |
Extend to include the points. More... | |
template<unsigned N> | |
void | add (const UList< point > &points, const FixedList< label, N > &indices) |
Extend to include a (subsetted) point field. More... | |
template<class IntContainer > | |
void | add (const UList< point > &points, const IntContainer &indices) |
Extend to include a (subsetted) point field. More... | |
void | grow (const scalar delta) |
Expand box by adjusting min/max by specified amount in each dimension. More... | |
void | grow (const vector &delta) |
Expand box by adjusting min/max by specified amounts. More... | |
void | inflate (const scalar factor) |
Expand box by factor*mag(span) in all dimensions. More... | |
void | inflate (Random &rndGen, const scalar factor) |
Expand box slightly by expanding all dimensions with factor*span*(random 0-1) and guarantees factor*mag(span) minimum width in any direction. More... | |
void | inflate (Random &r, const scalar factor, const scalar delta) |
As per two parameter version but with additional grow() by given amount in each dimension. More... | |
void | reduce () |
Inplace parallel reduction of min/max values. More... | |
bool | intersects (const plane &pln) const |
Does plane intersect this bounding box. More... | |
bool | intersects (const triPointRef &tri) const |
Does triangle intersect this bounding box or is contained within this bounding box. More... | |
bool | overlaps (const boundBox &bb) const |
Overlaps/touches boundingBox? More... | |
bool | overlaps (const point ¢re, const scalar radiusSqr) const |
Overlaps boundingSphere (centre + sqr(radius))? More... | |
bool | contains (const point &pt) const |
Contains point? (inside or on edge) More... | |
bool | contains (const boundBox &bb) const |
Fully contains other boundingBox? More... | |
bool | containsInside (const point &pt) const |
Contains point? (inside only) More... | |
bool | contains (const UList< point > &points) const |
Contains all points? (inside or on edge) More... | |
template<unsigned N> | |
bool | contains (const UList< point > &points, const FixedList< label, N > &indices) const |
Contains all of the (subsetted) points? (inside or on edge) More... | |
template<class IntContainer > | |
bool | contains (const UList< point > &points, const IntContainer &indices) const |
Contains all of the (subsetted) points? (inside or on edge) More... | |
bool | containsAny (const UList< point > &points) const |
Contains any of the points? (inside or on edge) More... | |
template<unsigned N> | |
bool | containsAny (const UList< point > &points, const FixedList< label, N > &indices) const |
Contains any of the (subsetted) points? (inside or on edge) More... | |
template<class IntContainer > | |
bool | containsAny (const UList< point > &points, const IntContainer &indices) const |
Contains any of the (subsetted) points? (inside or on edge) More... | |
point | nearest (const point &p) const |
Return the nearest point on the boundBox to the supplied point. More... | |
void | operator &= (const boundBox &bb) |
Restrict min/max to union with other box. More... | |
void | operator+= (const boundBox &bb) |
Extend box to include the second box, as per the add() method. More... | |
bool | intersect (const boundBox &bb) |
Deprecated(2022-10) - use 'operator&=' to avoid confusion with other intersects() methods. More... | |
point | midpoint () const |
Identical to centre() More... | |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<> | |
Foam::point | hexCorner () const |
template<Foam::direction CornerNumber> | |
Foam::point | hexCorner () const |
Static Public Member Functions | |
static const treeBoundBox & | null () noexcept |
The null treeBoundBox is the same as an inverted box. More... | |
static direction | subOctant (const point &mid, const point &pt) |
Returns octant number given point and midpoint. More... | |
static direction | subOctant (const point &mid, const point &pt, bool &onEdge) |
Returns octant number given point and midpoint. More... | |
static direction | subOctant (const point &mid, const vector &dir, const point &pt, bool &onEdge) |
Returns octant number given intersection and midpoint. More... | |
Static Public Member Functions inherited from boundBox | |
static const boundBox & | null () noexcept |
The null boundBox is the same as an inverted box. More... | |
static const Foam::faceList & | hexFaces () |
The boundBox faces as a hexCell, using hexCorner points. Same as hexCell::modelFaces() More... | |
static constexpr label | nPoints () noexcept |
Number of points for boundBox and HEX. More... | |
static constexpr label | nEdges () noexcept |
Number of edges for boundBox and HEX. More... | |
static constexpr label | nFaces () noexcept |
Number of faces for boundBox and HEX. More... | |
static boundBox | returnReduce (const boundBox &bb) |
Perform a reduction on a copy and return the result. More... | |
Static Public Attributes | |
static const faceList | faces |
Face to point addressing, using octant corner points. More... | |
static const edgeList | edges |
Edge to point addressing, using octant corner points. More... | |
Static Public Attributes inherited from boundBox | |
static const boundBox | greatBox |
A large boundBox: min/max == -/+ ROOTVGREAT. More... | |
static const boundBox | invertedBox |
A large inverted boundBox: min/max == +/- ROOTVGREAT. More... | |
static const FixedList< vector, 6 > | faceNormals |
The unit normal per face. More... | |
Friends | |
Istream & | operator>> (Istream &is, treeBoundBox &bb) |
Ostream & | operator<< (Ostream &os, const treeBoundBox &bb) |
Additional Inherited Members | |
Static Protected Member Functions inherited from boundBox | |
static bool | box_box_overlaps (const point &minA, const point &maxA, const point &minB, const point &maxB) |
Test for overlap of box and box (inclusive check) More... | |
static bool | box_sphere_overlaps (const point &corner0, const point &corner1, const point ¢re, const scalar radiusSqr) |
Test for overlap of box and boundingSphere (centre + sqr(radius)) More... | |
Standard boundBox with extra functionality for use in octree.
Numbering of corner points is according to octant numbering as shown below. For vertex numbering in the sequence 0 to 7:
Octant vertex ordering | Hex cell ordering (treeBoundBox) | (boundBox, blockMesh, hexCell) | 6 ---- 7 | 7 ---- 6 f5 |\ :\ f3 | f5 |\ :\ f3 | | 4 ---- 5 \ | | | 4 ---- 5 \ | 2.|....3 | \ | | 3.|....2 | \ | \| \| f2 | | \| \| f2 f4 0 ---- 1 | f4 0 ---- 1 Y Z | \ | f0 ------ f1 | f0 ------ f1 \| | o--- X |
Definition at line 90 of file treeBoundBox.H.
Bits used for octant/point directional encoding.
Every octant/corner point is the combination of three directions. Defined as (1 << vector::components).
Enumerator | |
---|---|
RIGHTHALF | 1: positive x-direction |
TOPHALF | 2: positive y-direction |
FRONTHALF | 4: positive z-direction |
Definition at line 104 of file treeBoundBox.H.
Face codes. Identical order and meaning as per hex cellmodel and boundBox, but have a different point ordering.
Defined as (2 * vector::components + positive).
Enumerator | |
---|---|
LEFT | 0: x-min face |
RIGHT | 1: x-max face |
BOTTOM | 2: y-min face |
TOP | 3: y-max face |
BACK | 4: z-min face |
FRONT | 5: z-max face |
Definition at line 117 of file treeBoundBox.H.
Bits used for face encoding.
Defined as (1 << (2 * vector::components + positive)). For example, the positive Z-face: (1 << (2 * vector::Z + 1))
Enumerator | |
---|---|
NOFACE | 0: none |
LEFTBIT | 1: x-min face |
RIGHTBIT | 2: x-max face |
BOTTOMBIT | 4: y-min face |
TOPBIT | 8: y-max face |
BACKBIT | 16: z-min face |
FRONTBIT | 32: z-max face |
Definition at line 134 of file treeBoundBox.H.
enum edgeId |
Edges codes.
E01 = edge between 0 and 1.
Enumerator | |
---|---|
E01 | |
E13 | |
E23 | |
E02 | |
E45 | |
E57 | |
E67 | |
E46 | |
E04 | |
E15 | |
E37 | |
E26 |
Definition at line 150 of file treeBoundBox.H.
|
default |
Default construct: an inverted bounding box.
|
default |
Copy construct.
|
inlineexplicit |
Copy construct from a boundBox.
Definition at line 214 of file treeBoundBox.H.
|
inlineexplicit |
Construct a 0/1 unit bounding box.
Definition at line 27 of file treeBoundBoxI.H.
|
inlineexplicit |
Construct a bounding box containing a single initial point.
Definition at line 33 of file treeBoundBoxI.H.
|
inline |
Construct from bound box min/max points.
Definition at line 39 of file treeBoundBoxI.H.
|
inlineexplicit |
Construct from bound box min/max points.
TBD: Construct from bound box min/max points inline explicit treeBoundBox(const MinMax<point>& bb);
Definition at line 45 of file treeBoundBoxI.H.
|
explicit |
Construct as the bounding box of the given pointField.
Local processor domain only (no reduce as in boundBox)
Definition at line 57 of file treeBoundBox.C.
References Foam::nl, treeBoundBox::points(), and WarningInFunction.
treeBoundBox | ( | const UList< point > & | points, |
const labelUList & | indices | ||
) |
Construct as subset of points.
Local processor domain only (no reduce as in boundBox)
Definition at line 70 of file treeBoundBox.C.
References UList< T >::empty(), Foam::nl, points, and WarningInFunction.
treeBoundBox | ( | const UList< point > & | points, |
const FixedList< label, N > & | indices | ||
) |
Construct as subset of points.
The indices could be from edge/triFace etc. Local processor domain only (no reduce as in boundBox)
Definition at line 28 of file treeBoundBoxTemplates.C.
References Foam::nl, points, and WarningInFunction.
|
inlineexplicit |
Construct from Istream.
Definition at line 51 of file treeBoundBoxI.H.
|
inlinestaticnoexcept |
The null treeBoundBox is the same as an inverted box.
Definition at line 187 of file treeBoundBox.H.
References boundBox::invertedBox.
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::bb(), and indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::bb().
|
default |
Copy assignment.
|
inline |
Copy assignment from a boundBox.
Definition at line 219 of file treeBoundBox.H.
Foam::tmp< Foam::pointField > points | ( | ) | const |
Vertex coordinates. In octant coding.
Definition at line 87 of file treeBoundBox.C.
References forAll, tmp< T >::New(), and pts.
Referenced by searchableBox::boundingSpheres(), searchableBox::coordinates(), triangleFuncs::intersectBb(), searchableBox::points(), treeBoundBox::treeBoundBox(), OBJstream::write(), AABBTreeBase::writeOBJ(), Foam::meshTools::writeOBJ(), and indexedOctreeBase::writeOBJ().
|
inline |
Corner point of given octant.
Definition at line 59 of file treeBoundBoxI.H.
References Foam::max(), Foam::min(), x, and y.
Foam::treeBoundBox subBbox | ( | const direction | octant | ) | const |
Sub-box of given octant. Midpoint calculated.
Definition at line 204 of file treeBoundBox.C.
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::insertIndex(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::print(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::print(), box::refineBox(), and dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::removeIndex().
Foam::treeBoundBox subBbox | ( | const point & | mid, |
const direction | octant | ||
) | const |
Sub-box given by octant number. Midpoint provided.
Definition at line 102 of file treeBoundBox.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, treeBoundBox::FRONTHALF, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), treeBoundBox::RIGHTHALF, and treeBoundBox::TOPHALF.
Foam::treeBoundBox subHalf | ( | const direction | whichFace | ) | const |
Sub-box half for given face.
Definition at line 185 of file treeBoundBox.C.
References Foam::max(), Foam::min(), and Y.
Foam::treeBoundBox subHalf | ( | const scalar | mid, |
const direction | whichFace | ||
) | const |
Sub-box half for given face with prescribed mid point value. Eg, subHalf(scalar, LEFT)
Definition at line 151 of file treeBoundBox.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, boundBox::max(), and boundBox::min().
|
inline |
Returns octant number given point and the calculated midpoint.
Definition at line 71 of file treeBoundBoxI.H.
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNode(), and indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findNode().
|
inlinestatic |
Returns octant number given point and midpoint.
Definition at line 80 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, treeBoundBox::RIGHTHALF, and treeBoundBox::TOPHALF.
|
inline |
Returns octant number given point and the calculated midpoint.
onEdge set if the point is on edge of subOctant
Definition at line 109 of file treeBoundBoxI.H.
|
inlinestatic |
Returns octant number given point and midpoint.
onEdge set if the point is on edge of subOctant
Definition at line 121 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, treeBoundBox::RIGHTHALF, and treeBoundBox::TOPHALF.
|
inlinestatic |
Returns octant number given intersection and midpoint.
onEdge set if the point is on edge of subOctant If onEdge, the direction vector determines which octant to use (acc. to which octant the point would be if it were moved along dir)
Definition at line 166 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, treeBoundBox::RIGHTHALF, and treeBoundBox::TOPHALF.
Calculates optimal order to look for nearest to point.
First will be the octant containing the point, second the octant with boundary nearest to the point etc.
Definition at line 220 of file treeBoundBoxI.H.
References treeBoundBox::FRONTHALF, Foam::max(), Foam::min(), treeBoundBox::RIGHTHALF, and treeBoundBox::TOPHALF.
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), and indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findNearest().
|
inline |
Return optimal search order to look for nearest to point.
Definition at line 310 of file treeBoundBoxI.H.
Does sub-octant overlap/touch boundingBox?
Definition at line 211 of file treeBoundBox.C.
References boundBox::max(), Foam::max(), boundBox::min(), and Foam::min().
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), and indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findNearest().
|
inline |
Does sub-octant overlap boundingSphere (centre + sqr(radius))?
Definition at line 319 of file treeBoundBoxI.H.
bool intersects | ( | const point & | overallStart, |
const vector & | overallVec, | ||
const point & | start, | ||
const point & | end, | ||
point & | pt, | ||
direction & | ptBits | ||
) | const |
Intersects segment; set point to intersection position and face,.
return true if intersection found. (pt argument used during calculation even if not intersecting). Calculates intersections from outside supplied vector (overallStart, overallVec). This is so when e.g. tracking through lots of consecutive boxes (typical octree) we're not accumulating truncation errors. Set to start, (end-start) if not used.
Definition at line 255 of file treeBoundBox.C.
References stdFoam::end(), Foam::mag(), Foam::max(), Foam::min(), and s.
Referenced by indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findLine(), triangleFuncs::intersectBb(), searchableRotatedBox::overlaps(), treeDataPrimitivePatch< PatchType >::overlaps(), treeDataFace::overlaps(), treeDataEdge::overlaps(), and streamLineBase::trimToBox().
Like above but does not return faces point is on.
Definition at line 402 of file treeBoundBox.C.
References stdFoam::end().
|
inline |
Like above but does not return faces point is on.
Definition at line 340 of file treeBoundBoxI.H.
References Foam::ln().
Contains point (inside or on edge) and moving in direction.
dir would cause it to go inside.
Definition at line 413 of file treeBoundBox.C.
References Foam::max(), Foam::min(), and Foam::expressions::Detail::nComponents().
Referenced by waveMethod::calculate(), surfaceFeatures::deleteBox(), dynamicTreeDataPoint::findNearest(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNode(), searchableBox::getVolumeType(), dynamicTreeDataPoint::overlaps(), treeDataPoint::overlaps(), AABBTree< Type >::pointInside(), streamLineBase::trimToBox(), and propellerInfo::updateSampleDiskCells().
Foam::direction faceBits | ( | const point & | pt | ) | const |
Code position of point on bounding box faces.
Definition at line 451 of file treeBoundBox.C.
References Foam::max(), and Foam::min().
Referenced by indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findLine().
Foam::direction posBits | ( | const point & | pt | ) | const |
Position of point relative to bounding box.
Definition at line 486 of file treeBoundBox.C.
References Foam::max(), and Foam::min().
Referenced by treeDataPrimitivePatch< PatchType >::findIntersection(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findLine(), treeDataCell::findIntersectOp::operator()(), and treeDataFace::findIntersectOp::operator()().
Calculate nearest and furthest (to point) vertex coords of.
bounding box
Definition at line 522 of file treeBoundBox.C.
References Foam::mag(), Foam::max(), Foam::min(), and Foam::expressions::Detail::nComponents().
Referenced by treeBoundBox::distanceCmp().
Foam::scalar maxDist | ( | const point & | pt | ) | const |
Returns distance point to furthest away corner.
Definition at line 548 of file treeBoundBox.C.
Foam::label distanceCmp | ( | const point & | pt, |
const treeBoundBox & | other | ||
) | const |
Compare distance to point with other bounding box.
return: -1 : all vertices of my bounding box are nearer than any of other +1 : all vertices of my bounding box are further away than any of other 0 : none of the above.
Definition at line 558 of file treeBoundBox.C.
References treeBoundBox::calcExtremities().
|
inline |
Return slightly wider bounding box.
Extends all dimensions with s*span*Random::sample01<scalar>() and guarantees in any direction s*mag(span) minimum width
Definition at line 350 of file treeBoundBoxI.H.
References boundBox::inflate(), and rndGen.
|
inline |
As per two parameter version but with additional grow() by given amount in each dimension.
Definition at line 364 of file treeBoundBoxI.H.
References delta, boundBox::inflate(), and rndGen.
|
inline |
Typical dimension length,height,width. Identical to avgDim()
Definition at line 548 of file treeBoundBox.H.
References boundBox::avgDim().
|
inline |
Overlaps with other bounding box, sphere etc?
Definition at line 439 of file boundBoxI.H.
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::findNearest(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::findNearest(), inverseDistance::markDonors(), trackingInverseDistance::markPatchesAsHoles(), inverseDistance::markPatchesAsHoles(), AABBTree< Type >::overlaps(), treeDataPrimitivePatch< PatchType >::overlaps(), treeDataCell::overlaps(), and treeDataFace::overlaps().
|
inline |
Overlaps with other bounding box, sphere etc?
Definition at line 446 of file boundBoxI.H.
bool intersects |
intersects other bounding box, sphere etc?
Definition at line 193 of file boundBox.C.
bool intersects |
intersects other bounding box, sphere etc?
Definition at line 227 of file boundBox.C.
|
inline |
Contains point or other bounding box?
Definition at line 455 of file boundBoxI.H.
|
inline |
Contains point or other bounding box?
Definition at line 466 of file boundBoxI.H.
bool contains |
Contains point or other bounding box?
Definition at line 366 of file boundBox.C.
|
inline |
Contains point or other bounding box?
Definition at line 113 of file boundBoxTemplates.C.
|
inline |
Contains point or other bounding box?
Definition at line 142 of file boundBoxTemplates.C.
|
friend |
|
friend |
|
static |
Face to point addressing, using octant corner points.
Definition at line 174 of file treeBoundBox.H.
Referenced by searchableBox::boundingSpheres(), searchableBox::coordinates(), searchableRotatedBox::overlaps(), and OBJstream::write().
|
static |
Edge to point addressing, using octant corner points.
Definition at line 179 of file treeBoundBox.H.
Referenced by triangleFuncs::intersectBb(), searchableRotatedBox::overlaps(), and OBJstream::write().