35 vector(-GREAT, -GREAT, -GREAT),
36 vector(GREAT, GREAT, GREAT)
42 vector(GREAT, GREAT, GREAT),
43 vector(-GREAT, -GREAT, -GREAT)
63 initListList<face, label, 6, 4>(facesArray)
107 edges[edgeI][0] = edgesArray[edgeI][0];
108 edges[edgeI][1] = edgesArray[edgeI][1];
116 FixedList<vector, 6> normals;
136 <<
"cannot find bounding box for zero-sized pointField, " 137 <<
"returning zero" <<
endl;
155 <<
"cannot find bounding box for zero-sized pointField, " 156 <<
"returning zero" <<
endl;
172 points[octant] =
corner(octant);
194 <<
"octant should be [0..7]" 236 const point& overallStart,
264 for (
label i = 0; i < 4; ++i)
275 if ((ptBits & endBits) != 0)
287 scalar
s = (
min().
x() - overallStart.
x())/overallVec.
x();
289 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
290 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
304 scalar
s = (
max().
x() - overallStart.
x())/overallVec.
x();
306 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
307 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
319 scalar
s = (
min().
y() - overallStart.
y())/overallVec.
y();
320 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
322 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
334 scalar
s = (
max().
y() - overallStart.
y())/overallVec.
y();
335 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
337 pt.
z() = overallStart.
z() + overallVec.
z()*
s;
349 scalar
s = (
min().
z() - overallStart.
z())/overallVec.
z();
350 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
351 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
364 scalar
s = (
max().
z() - overallStart.
z())/overallVec.
z();
365 pt.
x() = overallStart.
x() + overallVec.
x()*
s;
366 pt.
y() = overallStart.
y() + overallVec.
y()*
s;
389 return intersects(start, end-start, start, end, pt, ptBits);
399 if (pt[cmpt] <
min()[cmpt])
403 else if (pt[cmpt] ==
min()[cmpt])
412 if (pt[cmpt] >
max()[cmpt])
416 else if (pt[cmpt] ==
max()[cmpt])
434 if (pt.
x() ==
min().
x())
438 else if (pt.
x() ==
max().
x())
443 if (pt.
y() ==
min().
y())
447 else if (pt.
y() ==
max().
y())
452 if (pt.
z() ==
min().
z())
456 else if (pt.
z() ==
max().
z())
468 if (pt.
x() <
min().
x())
472 else if (pt.
x() >
max().
x())
477 if (pt.
y() <
min().
y())
481 else if (pt.
y() >
max().
y())
486 if (pt.
z() <
min().
z())
490 else if (pt.
z() >
max().
z())
505 scalar nearX, nearY, nearZ;
506 scalar farX, farY, farZ;
541 nearest =
point(nearX, nearY, nearZ);
542 furthest =
point(farX, farY, farZ);
565 point nearThis, farThis;
570 const scalar minDistThis =
571 sqr(nearThis.
x() - pt.
x())
572 +
sqr(nearThis.
y() - pt.
y())
573 +
sqr(nearThis.
z() - pt.
z());
574 const scalar maxDistThis =
575 sqr(farThis.
x() - pt.
x())
576 +
sqr(farThis.
y() - pt.
y())
577 +
sqr(farThis.
z() - pt.
z());
583 point nearOther, farOther;
588 const scalar minDistOther =
589 sqr(nearOther.x() - pt.
x())
590 +
sqr(nearOther.y() - pt.
y())
591 +
sqr(nearOther.z() - pt.
z());
592 const scalar maxDistOther =
593 sqr(farOther.x() - pt.
x())
594 +
sqr(farOther.y() - pt.
y())
595 +
sqr(farOther.z() - pt.
z());
600 if (maxDistThis < minDistOther)
605 else if (minDistThis > maxDistOther)
625 static_cast<const boundBox&>(b)
640 return os << static_cast<const boundBox&>(bb);
646 return is >>
static_cast<boundBox&
>(bb);
static const FixedList< vector, 6 > faceNormals
Per face the unit normal.
boundBox()
Construct null, setting points to zero.
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A 1D vector of objects of type <T> with a fixed size <Size>.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
point corner(const direction) const
Corner point given octant.
static const treeBoundBox greatBox
As per boundBox::greatBox, but with GREAT instead of VGREAT.
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
treeBoundBox subBbox(const direction) const
Sub box given by octant number. Midpoint calculated.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
direction faceBits(const point &) const
Code position of point on bounding box faces.
static faceList faces()
Return faces with correct point order.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A bounding box defined in terms of the points at its extremities.
Vector< scalar > vector
A scalar version of the templated Vector.
direction posBits(const point &) const
Position of point relative to bounding box.
Various functions to operate on Lists.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
vectorField pointField
pointField is a vectorField.
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,.
treeBoundBox()
Construct null setting points to zero.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Istream & operator>>(Istream &, directionInfo &)
static const edgeList edges
Edge to point addressing.
errorManip< error > abort(error &err)
point midpoint() const
The midpoint of the bounding box.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void calcExtremities(const point &pt, point &nearest, point &furthest) const
Calculate nearest and furthest (to point) vertex coords of.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
scalar maxDist(const point &) const
Returns distance point to furthest away corner.
const point & max() const
Maximum describing the bounding box.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
label distanceCmp(const point &, const treeBoundBox &other) const
Compare distance to point with other bounding box.
Ostream & operator<<(Ostream &, const ensightPart &)
static const treeBoundBox invertedBox
As per boundBox::invertedBox, but with GREAT instead of VGREAT.
tmp< pointField > points() const
Vertex coordinates. In octant coding.
Standard boundBox + extra functionality for use in octree.
dimensioned< scalar > mag(const dimensioned< Type > &)
const point & min() const
Minimum describing the bounding box.
A class for managing temporary objects.
bool operator!=(const particle &, const particle &)
static const scalar great
The great value used for greatBox and invertedBox.