Standard boundBox with extra functionality for use in octree. More...
#include <treeBoundBox.H>


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. | |
| treeBoundBox (const treeBoundBox &)=default | |
| Copy construct. | |
| treeBoundBox & | operator= (const treeBoundBox &)=default |
| Copy assignment. | |
| treeBoundBox (const boundBox &bb) | |
| Copy construct from a boundBox. | |
| void | operator= (const boundBox &bb) |
| Copy assignment from a boundBox. | |
| treeBoundBox (Foam::zero_one) | |
| Construct a 0/1 unit bounding box. | |
| treeBoundBox (const point &p) | |
| Construct a bounding box containing a single initial point. | |
| treeBoundBox (const point &min, const point &max) | |
| Construct from bound box min/max points. | |
| treeBoundBox (const Pair< point > &bb) | |
| Construct from bound box min/max points. | |
| treeBoundBox (const UList< point > &points) | |
| Construct as the bounding box of the given pointField. | |
| treeBoundBox (const UList< point > &points, const labelUList &indices) | |
| Construct as subset of points. | |
| template<unsigned N> | |
| treeBoundBox (const UList< point > &points, const FixedList< label, N > &indices) | |
| Construct as subset of points. | |
| treeBoundBox (Istream &is) | |
| Construct from Istream. | |
| tmp< pointField > | points () const |
| Vertex coordinates. In octant coding. | |
| point | corner (const direction octant) const |
| Corner point of given octant. | |
| treeBoundBox | subBbox (const direction octant) const |
| Sub-box of given octant. Midpoint calculated. | |
| treeBoundBox | subBbox (const point &mid, const direction) const |
| Sub-box given by octant number. Midpoint provided. | |
| treeBoundBox | subHalf (const direction whichFace) const |
| Sub-box half for given face. | |
| treeBoundBox | subHalf (const scalar mid, const direction whichFace) const |
| Sub-box half for given face with prescribed mid point value. Eg, subHalf(scalar, LEFT). | |
| direction | subOctant (const point &pt) const |
| Returns octant number given point and the calculated midpoint. | |
| direction | subOctant (const point &pt, bool &onEdge) const |
| Returns octant number given point and the calculated midpoint. | |
| void | searchOrder (const point &pt, FixedList< direction, 8 > &octantOrder) const |
| Calculates optimal order to look for nearest to point. | |
| FixedList< direction, 8 > | searchOrder (const point &pt) const |
| Return optimal search order to look for nearest to point. | |
| bool | subOverlaps (const direction octant, const boundBox &bb) const |
| Does sub-octant overlap/touch boundingBox? | |
| bool | subOverlaps (const direction octant, const point ¢re, const scalar radiusSqr) const |
| Does sub-octant overlap boundingSphere (centre + sqr(radius))? | |
| 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,. | |
| bool | intersects (const point &start, const point &end, point &pt) const |
| Like above but does not return faces point is on. | |
| bool | intersects (const linePointRef &ln, point &pt) const |
| Like above but does not return faces point is on. | |
| bool | contains (const vector &dir, const point &) const |
| Contains point (inside or on edge) and moving in direction. | |
| direction | faceBits (const point &pt) const |
| Code position of point on bounding box faces. | |
| direction | posBits (const point &pt) const |
| Position of point relative to bounding box. | |
| void | calcExtremities (const point &pt, point &nearest, point &furthest) const |
| Calculate nearest and furthest (to point) vertex coords of. | |
| scalar | maxDist (const point &pt) const |
| Returns distance point to furthest away corner. | |
| label | distanceCmp (const point &pt, const treeBoundBox &other) const |
| Compare distance to point with other bounding box. | |
| treeBoundBox | extend (Random &rndGen, const scalar s) const |
| Return slightly wider bounding box. | |
| 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. | |
| scalar | typDim () const |
| Typical dimension length,height,width. Identical to avgDim(). | |
| bool | overlaps (const boundBox &bb) const |
| Overlaps with other bounding box, sphere etc? | |
| bool | overlaps (const point ¢re, const scalar radiusSqr) const |
| Overlaps with other bounding box, sphere etc? | |
| bool | intersects (const plane &pln) const |
| intersects other bounding box, sphere etc? | |
| bool | intersects (const triPointRef &tri) const |
| intersects other bounding box, sphere etc? | |
| bool | contains (const point &pt) const |
| Contains point or other bounding box? | |
| bool | contains (const boundBox &bb) const |
| Contains point or other bounding box? | |
| bool | contains (const UList< point > &points) const |
| Contains point or other bounding box? | |
| template<unsigned N> | |
| bool | contains (const UList< point > &points, const FixedList< label, N > &indices) const |
| Contains point or other bounding box? | |
| template<class IntContainer> | |
| bool | contains (const UList< point > &points, const IntContainer &indices) const |
| Contains point or other bounding box? | |
| Public Member Functions inherited from boundBox | |
| boundBox () | |
| Default construct: an inverted bounding box. | |
| boundBox (const boundBox &)=default | |
| Copy construct. | |
| boundBox & | operator= (const boundBox &)=default |
| Copy assignment. | |
| boundBox (const boundBox &bb, bool doReduce) | |
| Copy construct with specified global reduction. | |
| boundBox (const point &p) | |
| Construct a bounding box containing a single initial point. | |
| boundBox (Foam::zero_one) | |
| Construct a 0/1 unit bounding box. | |
| boundBox (const point &min, const point &max) | |
| Construct from bound box min/max points. | |
| boundBox (const Pair< point > &bb) | |
| Construct from bound box min/max points. | |
| boundBox (const UList< point > &points, bool doReduce=true) | |
| Construct as the bounding box of the given points. | |
| boundBox (const tmp< pointField > &tpoints, bool doReduce=true) | |
| Construct as the bounding box of the given temporary pointField. | |
| boundBox (const UList< point > &points, const labelUList &indices, bool doReduce=true) | |
| Construct bounding box as an indirect subset of the points. | |
| 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. | |
| boundBox (Istream &is) | |
| Construct from Istream. | |
| bool | empty () const |
| Bounding box is inverted, contains no points. | |
| bool | good () const |
| Bounding box is non-inverted. | |
| bool | valid () const |
| Bounding box is non-inverted - same as good(). | |
| const point & | min () const noexcept |
| Minimum describing the bounding box. | |
| const point & | max () const noexcept |
| Maximum describing the bounding box. | |
| point & | min () noexcept |
| Minimum describing the bounding box, non-const access. | |
| point & | max () noexcept |
| Maximum describing the bounding box, non-const access. | |
| point | centre () const |
| The centre (midpoint) of the bounding box. | |
| vector | span () const |
| The bounding box span (from minimum to maximum). | |
| scalar | mag () const |
| The magnitude/length of the bounding box diagonal. | |
| scalar | magSqr () const |
| The magnitude/length squared of bounding box diagonal. | |
| scalar | volume () const |
| The volume of the bound box. | |
| scalar | minDim () const |
| Smallest length/height/width dimension. | |
| scalar | maxDim () const |
| Largest length/height/width dimension. | |
| scalar | avgDim () const |
| Average length/height/width dimension. | |
| direction | minDir () const |
| Direction (X/Y/Z) of the smallest span (for empty box: 0). | |
| direction | maxDir () const |
| Direction (X/Y/Z) of the largest span (for empty box: 0). | |
| int | nDim () const |
| Count the number of positive, non-zero dimensions. | |
| template<direction CornerNumber> | |
| point | hexCorner () const |
| Return corner point [0..7] corresponding to a 'hex' cell. | |
| tmp< pointField > | hexCorners () const |
| Corner points in an order corresponding to a 'hex' cell. | |
| tmp< pointField > | points () const |
| Corner points in an order corresponding to a 'hex' cell. | |
| tmp< pointField > | faceCentres () const |
| Face midpoints. | |
| point | faceCentre (const direction facei) const |
| Face centre of given face index. | |
| void | reset () |
| Reset to an inverted box. | |
| void | reset (Foam::zero_one) |
| Reset to a 0/1 unit bounding box. | |
| void | reset (const point &pt) |
| Reset min/max to be identical to the specified point. | |
| void | reset (const point &min, const point &max) |
| Reset min/max to specified values. | |
| void | clear () |
| Same as reset() - reset to an inverted box. | |
| void | add (const boundBox &bb) |
| Extend to include the second box. | |
| void | add (const point &pt) |
| Extend to include the point. | |
| void | add (const point &pt0, const point &pt1) |
| Extend to include two additional points. | |
| void | add (const Pair< point > &points) |
| Extend to include two additional points. | |
| void | add (const UList< point > &points) |
| Extend to include the points. | |
| void | add (const tmp< pointField > &tpoints) |
| Extend to include the points from the temporary point field. | |
| template<unsigned N> | |
| void | add (const FixedList< point, N > &points) |
| Extend to include the points. | |
| template<unsigned N> | |
| void | add (const UList< point > &points, const FixedList< label, N > &indices) |
| Extend to include a (subsetted) point field. | |
| template<class IntContainer> | |
| void | add (const UList< point > &points, const IntContainer &indices) |
| Extend to include a (subsetted) point field. | |
| void | grow (const scalar delta) |
| Expand box by adjusting min/max by specified amount in each dimension. | |
| void | grow (const vector &delta) |
| Expand box by adjusting min/max by specified amounts. | |
| void | inflate (const scalar factor) |
| Expand box by factor*mag(span) in all dimensions. | |
| 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. | |
| 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. | |
| void | reduce () |
| Inplace parallel reduction of min/max values, using UPstream::worldComm. | |
| void | reduce (int communicator) |
| Inplace parallel reduction of min/max values, using the specified communicator. | |
| bool | intersects (const plane &pln) const |
| Does plane intersect this bounding box. | |
| bool | intersects (const triPointRef &tri) const |
| Does triangle intersect this bounding box or is contained within this bounding box. | |
| bool | overlaps (const boundBox &bb) const |
| Overlaps/touches boundingBox? | |
| bool | overlaps (const point ¢re, const scalar radiusSqr) const |
| Overlaps boundingSphere (centre + sqr(radius))? | |
| bool | contains (const point &pt) const |
| Contains point? (inside or on edge). | |
| bool | contains (const boundBox &bb) const |
| Fully contains other boundingBox? | |
| bool | containsInside (const point &pt) const |
| Contains point? (inside only). | |
| bool | contains (const UList< point > &points) const |
| Contains all points? (inside or on edge). | |
| 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). | |
| template<class IntContainer> | |
| bool | contains (const UList< point > &points, const IntContainer &indices) const |
| Contains all of the (subsetted) points? (inside or on edge). | |
| bool | containsAny (const UList< point > &points) const |
| Contains any of the points? (inside or on edge). | |
| 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). | |
| template<class IntContainer> | |
| bool | containsAny (const UList< point > &points, const IntContainer &indices) const |
| Contains any of the (subsetted) points? (inside or on edge). | |
| point | nearest (const point &p) const |
| Return the nearest point on the boundBox to the supplied point. | |
| void | operator&= (const boundBox &bb) |
| Restrict min/max to union with other box. | |
| void | operator+= (const boundBox &bb) |
| Extend box to include the second box, as per the add() method. | |
| bool | intersect (const boundBox &bb) |
| Deprecated(2022-10) - use 'operator&=' to avoid confusion with other intersects() methods. | |
| point | midpoint () const |
| Identical to centre(). | |
| 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. | |
| static direction | subOctant (const point &mid, const point &pt) |
| Returns octant number given point and midpoint. | |
| static direction | subOctant (const point &mid, const point &pt, bool &onEdge) |
| Returns octant number given point and midpoint. | |
| static direction | subOctant (const point &mid, const vector &dir, const point &pt, bool &onEdge) |
| Returns octant number given intersection and midpoint. | |
| Static Public Member Functions inherited from boundBox | |
| static const boundBox & | null () noexcept |
| The null boundBox is the same as an inverted box. | |
| static const Foam::faceList & | hexFaces () |
| The boundBox faces as a hexCell, using hexCorner points. Same as hexCell::modelFaces(). | |
| static constexpr label | nPoints () noexcept |
| Number of points for boundBox and HEX. | |
| static constexpr label | nEdges () noexcept |
| Number of edges for boundBox and HEX. | |
| static constexpr label | nFaces () noexcept |
| Number of faces for boundBox and HEX. | |
| static boundBox | returnReduce (const boundBox &bb) |
| Perform a reduction on a copy and return the result, using UPstream::worldComm. | |
| static boundBox | returnReduce (const boundBox &bb, int communicator) |
| Perform a reduction on a copy and return the result, using the specified communicator. | |
Static Public Attributes | |
| static const faceList | faces |
| Face to point addressing, using octant corner points. | |
| static const edgeList | edges |
| Edge to point addressing, using octant corner points. | |
| Static Public Attributes inherited from boundBox | |
| static const boundBox | greatBox |
| A large boundBox: min/max == -/+ ROOTVGREAT. | |
| static const boundBox | invertedBox |
| A large inverted boundBox: min/max == +/- ROOTVGREAT. | |
| static const FixedList< vector, 6 > | faceNormals |
| The unit normal per face. | |
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). | |
| 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)). | |
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.
Referenced by distanceCmp(), extend(), extend(), searchableBox::findNearest(), null(), operator<<, operator=(), operator>>, searchableBox::searchableBox(), searchableBox::searchableBox(), subBbox(), subBbox(), subHalf(), subHalf(), treeBoundBox(), and searchableBox::TypeName().

|
default |
|
inlineexplicit |
Copy construct from a boundBox.
Definition at line 214 of file treeBoundBox.H.
References boundBox::boundBox().

|
inlineexplicit |
Construct a 0/1 unit bounding box.
Definition at line 27 of file treeBoundBoxI.H.
References boundBox::boundBox().

|
inlineexplicit |
Construct a bounding box containing a single initial point.
Definition at line 33 of file treeBoundBoxI.H.
References boundBox::boundBox(), and p.

Construct from bound box min/max points.
Definition at line 39 of file treeBoundBoxI.H.
References boundBox::boundBox(), boundBox::max(), and boundBox::min().

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.
References boundBox::boundBox().

Construct as the bounding box of the given pointField.
Local processor domain only (no reduce as in boundBox)
References points().

| treeBoundBox | ( | const UList< point > & | points, |
| const labelUList & | indices ) |
|
inlineexplicit |
Construct from Istream.
Definition at line 51 of file treeBoundBoxI.H.
References boundBox::boundBox().

|
inlinestaticnoexcept |
The null treeBoundBox is the same as an inverted box.
Definition at line 187 of file treeBoundBox.H.
References boundBox::invertedBox, Foam::noexcept, and treeBoundBox().
Referenced by dynamicIndexedOctree< Type >::bb(), and indexedOctree< treeDataIndirectTriSurface >::bb().


|
default |
|
inline |
Copy assignment from a boundBox.
Definition at line 219 of file treeBoundBox.H.
References boundBox::boundBox().

| tmp< pointField > points | ( | ) | const |
Vertex coordinates. In octant coding.
Referenced by searchableBox::boundingSpheres(), searchableBox::coordinates(), triangleFuncs::intersectBb(), searchableBox::points(), treeBoundBox(), treeBoundBox(), treeBoundBox(), OBJstream::write(), AABBTreeBase::writeOBJ(), indexedOctreeBase::writeOBJ(), and Foam::meshTools::writeOBJ().

|
inline |
Corner point of given octant.
Definition at line 59 of file treeBoundBoxI.H.
References FRONTHALF, Foam::max(), Foam::min(), RIGHTHALF, TOPHALF, x, and y.
Referenced by subOverlaps().


| treeBoundBox subBbox | ( | const direction | octant | ) | const |
Sub-box of given octant. Midpoint calculated.
References treeBoundBox().
Referenced by dynamicIndexedOctree< Type >::insertIndex(), box::refineBox(), box::refineBox(), and dynamicIndexedOctree< Type >::removeIndex().


| treeBoundBox subBbox | ( | const point & | mid, |
| const direction | ) const |
Sub-box given by octant number. Midpoint provided.
References treeBoundBox().

| treeBoundBox subHalf | ( | const direction | whichFace | ) | const |
| treeBoundBox subHalf | ( | const scalar | mid, |
| const direction | whichFace ) const |
Sub-box half for given face with prescribed mid point value. Eg, subHalf(scalar, LEFT).
References boundBox::overlaps(), and treeBoundBox().

|
inline |
Returns octant number given point and the calculated midpoint.
Definition at line 71 of file treeBoundBoxI.H.
References boundBox::centre(), and subOctant().
Referenced by dynamicIndexedOctree< Type >::findNode(), indexedOctree< Type >::findNode(), subOctant(), and subOctant().


|
inlinestatic |
Returns octant number given point and midpoint.
Definition at line 79 of file treeBoundBoxI.H.
References FRONTHALF, RIGHTHALF, TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

|
inline |
Returns octant number given point and the calculated midpoint.
onEdge set if the point is on edge of subOctant
Definition at line 108 of file treeBoundBoxI.H.
References boundBox::centre(), and subOctant().

|
inlinestatic |
Returns octant number given point and midpoint.
onEdge set if the point is on edge of subOctant
Definition at line 120 of file treeBoundBoxI.H.
References FRONTHALF, RIGHTHALF, TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

|
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 165 of file treeBoundBoxI.H.
References FRONTHALF, RIGHTHALF, TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

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 219 of file treeBoundBoxI.H.
References boundBox::centre(), FRONTHALF, boundBox::max(), boundBox::min(), RIGHTHALF, TOPHALF, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::dynamicIndexedOctree(), dynamicIndexedOctree< Type >::findNearest(), indexedOctree< Type >::findNearest(), and searchOrder().


|
inline |
Return optimal search order to look for nearest to point.
Definition at line 310 of file treeBoundBoxI.H.
References searchOrder().

Does sub-octant overlap/touch boundingBox?
References boundBox::boundBox(), boundBox::centre(), and boundBox::intersects().
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::dynamicIndexedOctree(), dynamicIndexedOctree< Type >::findNearest(), and indexedOctree< Type >::findNearest().


|
inline |
Does sub-octant overlap boundingSphere (centre + sqr(radius))?
Definition at line 318 of file treeBoundBoxI.H.
References boundBox::box_sphere_overlaps(), boundBox::centre(), and corner().

| 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.
Referenced by indexedOctree< treeDataIndirectTriSurface >::findLine(), searchableBox::findLine(), triangleFuncs::intersectBb(), intersects(), searchableRotatedBox::overlaps(), treeDataEdge::overlaps(), treeDataFace::overlaps(), treeDataPrimitivePatch< PatchType >::overlaps(), and streamLineBase::trimToBox().

Like above but does not return faces point is on.
References boundBox::contains(), and Foam::ln().

|
inline |
Like above but does not return faces point is on.
Definition at line 339 of file treeBoundBoxI.H.
References intersects(), and Foam::ln().

Contains point (inside or on edge) and moving in direction.
dir would cause it to go inside.
Referenced by waveMethod::calculate(), surfaceFeatures::deleteBox(), dynamicTreeDataPoint::findNearest(), dynamicIndexedOctree< Type >::findNode(), searchableBox::getVolumeType(), dynamicTreeDataPoint::overlaps(), treeDataPoint::overlaps(), streamLineBase::trimToBox(), propellerInfo::updateSampleDiskCells(), and indexedOctree< treeType >::write().

Code position of point on bounding box faces.
Referenced by indexedOctree< treeDataIndirectTriSurface >::findLine().

Position of point relative to bounding box.
Referenced by treeDataPrimitivePatch< PatchType >::findIntersection(), indexedOctree< treeDataIndirectTriSurface >::findLine(), searchableBox::findLine(), treeDataCell::findIntersectOp::operator()(), and treeDataFace::findIntersectOp::operator()().

Calculate nearest and furthest (to point) vertex coords of.
bounding box
References boundBox::nearest().

| scalar maxDist | ( | const point & | pt | ) | const |
Returns distance point to furthest away corner.
| 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.
References delta, rndGen, s(), and treeBoundBox().

|
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 349 of file treeBoundBoxI.H.
References boundBox::inflate(), rndGen, and treeBoundBox().
Referenced by meshRefinement::distribute(), and mappedPatchBase::findLocalSamples().


|
inline |
As per two parameter version but with additional grow() by given amount in each dimension.
Definition at line 363 of file treeBoundBoxI.H.
References delta, boundBox::inflate(), rndGen, and treeBoundBox().

|
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 563 of file boundBoxI.H.
Referenced by dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::dynamicIndexedOctree(), dynamicIndexedOctree< Type >::findNearest(), indexedOctree< Type >::findNearest(), inverseDistance::markDonors(), trackingInverseDistance::markDonors(), inverseDistance::markPatchesAsHoles(), trackingInverseDistance::markPatchesAsHoles(), treeDataCell::overlaps(), treeDataFace::overlaps(), treeDataPrimitivePatch< PatchType >::overlaps(), box::refineBox(), and box::refineBox().

|
inline |
Overlaps with other bounding box, sphere etc?
Definition at line 568 of file boundBoxI.H.
| bool intersects | ( | const plane & | pln | ) | const |
intersects other bounding box, sphere etc?
| bool intersects | ( | const triPointRef & | tri | ) | const |
intersects other bounding box, sphere etc?
|
inline |
Contains point or other bounding box?
Definition at line 577 of file boundBoxI.H.
|
inline |
Contains point or other bounding box?
Definition at line 582 of file boundBoxI.H.
| bool contains | ( | const UList< point > & | points, |
| const FixedList< label, N > & | indices ) const |
Contains point or other bounding box?
| bool contains | ( | const UList< point > & | points, |
| const IntContainer & | indices ) const |
Contains point or other bounding box?
|
friend |
References treeBoundBox().
|
friend |
References os(), and treeBoundBox().
|
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(), OBJstream::write(), box::writeBoxes(), AABBTreeBase::writeOBJ(), and indexedOctreeBase::writeOBJ().
|
static |
Edge to point addressing, using octant corner points.
Definition at line 179 of file treeBoundBox.H.
Referenced by triangleFuncs::intersectBb(), searchableRotatedBox::overlaps(), OBJstream::write(), AABBTreeBase::writeOBJ(), indexedOctreeBase::writeOBJ(), and Foam::meshTools::writeOBJ().