49 return point(max_.x(), min_.y(), min_.z());
56 return point(max_.x(), max_.y(), min_.z());
63 return point(min_.x(), max_.y(), min_.z());
70 return point(min_.x(), min_.y(), max_.z());
77 return point(max_.x(), min_.y(), max_.z());
91 return point(min_.x(), max_.y(), max_.z());
98template<Foam::direction CornerNumber>
101 static_assert(CornerNumber < 8,
"Corner index [0..7]");
156 (max_.x() < min_.x())
157 || (max_.y() < min_.y())
158 || (max_.z() < min_.z())
195 return 0.5 * (min_ + max_);
201 return (max_ - min_);
207 return min_.
dist(max_);
213 return min_.distSqr(max_);
245 scalar best = ROOTVGREAT;
249 const scalar dist = (max_[dir] - min_[dir]);
250 if (dist < best && dist > 0)
269 const scalar dist = (max_[dir] - min_[dir]);
287 const scalar dist = (max_[dir] - min_[dir]);
402 minA.
x() <= maxB.
x() && minB.
x() <= maxA.
x()
403 && minA.
y() <= maxB.
y() && minB.
y() <= maxA.
y()
404 && minA.
z() <= maxB.
z() && minB.
z() <= maxA.
z()
411 const point& corner0,
412 const point& corner1,
414 const scalar radiusSqr
423 const scalar d0 = corner0[dir] - centre[dir];
424 const scalar d1 = corner1[dir] - centre[dir];
426 if ((d0 > 0) != (d1 > 0))
435 if (distSqr > radiusSqr)
455 const scalar radiusSqr
466 min_.x() <= pt.
x() && pt.
x() <= max_.x()
467 && min_.y() <= pt.
y() && pt.
y() <= max_.y()
468 && min_.z() <= pt.
z() && pt.
z() <= max_.z()
483 min_.x() < pt.
x() && pt.
x() < max_.x()
484 && min_.y() < pt.
y() && pt.
y() < max_.y()
485 && min_.z() < pt.
z() && pt.
z() < max_.z()
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An ordered pair of two objects of type <T> with first() and second() elements.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static constexpr direction nComponents
Number of components in this vector space.
const Cmpt & x() const noexcept
Access to the vector x component.
scalar dist(const Vector< Cmpt > &v2) const
The L2-norm distance from another vector. The mag() of the difference.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
bool containsInside(const point &pt) const
Contains point? (inside only).
int nDim() const
Count the number of positive, non-zero dimensions.
const point & max() const noexcept
Maximum describing the bounding box.
void grow(const scalar delta)
Expand box by adjusting min/max by specified amount in each dimension.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
tmp< pointField > points() const
Corner points in an order corresponding to a 'hex' cell.
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)).
direction minDir() const
Direction (X/Y/Z) of the smallest span (for empty box: 0).
const point & min() const noexcept
Minimum describing the bounding box.
bool contains(const point &pt) const
Contains point? (inside or on edge).
scalar volume() const
The volume of the bound box.
bool empty() const
Bounding box is inverted, contains no points.
void add(const boundBox &bb)
Extend to include the second box.
direction maxDir() const
Direction (X/Y/Z) of the largest span (for empty box: 0).
scalar minDim() const
Smallest length/height/width dimension.
scalar mag() const
The magnitude/length of the bounding box diagonal.
scalar avgDim() const
Average length/height/width dimension.
boundBox()
Default construct: an inverted bounding box.
bool good() const
Bounding box is non-inverted.
void reset()
Reset to an inverted box.
scalar magSqr() const
The magnitude/length squared of bounding box diagonal.
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
point hexCorner() const
Return corner point [0..7] corresponding to a 'hex' cell.
vector span() const
The bounding box span (from minimum to maximum).
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).
point centre() const
The centre (midpoint) of the bounding box.
scalar maxDim() const
Largest length/height/width dimension.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class for managing temporary objects.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Istream & operator>>(Istream &, directionInfo &)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
vector point
Point is a vector.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)