71#ifndef Foam_treeBoundBox_H
72#define Foam_treeBoundBox_H
344 const scalar radiusSqr
360 const point& overallStart,
466 #include "treeBoundBox.txx"
A 1D vector of objects of type <T> with a fixed length <N>.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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...
A bounding box defined in terms of min/max extrema points.
const point & max() const noexcept
Maximum describing the bounding box.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
const point & min() const noexcept
Minimum describing the bounding box.
bool contains(const point &pt) const
Contains point? (inside or on edge).
point nearest(const point &p) const
Return the nearest point on the boundBox to the supplied point.
scalar avgDim() const
Average length/height/width dimension.
boundBox()
Default construct: an inverted bounding box.
bool intersects(const plane &pln) const
Does plane intersect this bounding box.
point centre() const
The centre (midpoint) of the bounding box.
A class for managing temporary objects.
Standard boundBox with extra functionality for use in octree.
void calcExtremities(const point &pt, point &nearest, point &furthest) const
Calculate nearest and furthest (to point) vertex coords of.
treeBoundBox(const boundBox &bb)
Copy construct from a boundBox.
scalar typDim() const
Typical dimension length,height,width. Identical to avgDim().
faceBit
Bits used for face encoding.
treeBoundBox extend(Random &rndGen, const scalar s) const
Return slightly wider bounding box.
static const edgeList edges
Edge to point addressing, using octant corner points.
static const faceList faces
Face to point addressing, using octant corner points.
void searchOrder(const point &pt, FixedList< direction, 8 > &octantOrder) const
Calculates optimal order to look for nearest to point.
tmp< pointField > points() const
Vertex coordinates. In octant coding.
treeBoundBox(const UList< point > &points, const labelUList &indices)
Construct as subset of points.
friend Istream & operator>>(Istream &is, treeBoundBox &bb)
treeBoundBox(const UList< point > &points, const FixedList< label, N > &indices)
Construct as subset of points.
label distanceCmp(const point &pt, const treeBoundBox &other) const
Compare distance to point with other bounding box.
friend Ostream & operator<<(Ostream &os, const treeBoundBox &bb)
scalar maxDist(const point &pt) const
Returns distance point to furthest away corner.
treeBoundBox subBbox(const direction octant) const
Sub-box of given octant. Midpoint calculated.
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,.
point corner(const direction octant) const
Corner point of given octant.
treeBoundBox()=default
Default construct: an inverted bounding box.
void operator=(const boundBox &bb)
Copy assignment from a boundBox.
bool subOverlaps(const direction octant, const boundBox &bb) const
Does sub-octant overlap/touch boundingBox?
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
static const treeBoundBox & null() noexcept
The null treeBoundBox is the same as an inverted box.
faceId
Face codes. Identical order and meaning as per hex cellmodel and boundBox, but have a different point...
direction subOctant(const point &pt) const
Returns octant number given point and the calculated midpoint.
treeBoundBox subHalf(const direction whichFace) const
Sub-box half for given face.
octantBit
Bits used for octant/point directional encoding.
@ TOPHALF
2: positive y-direction
@ RIGHTHALF
1: positive x-direction
@ FRONTHALF
4: positive z-direction
direction faceBits(const point &pt) const
Code position of point on bounding box faces.
treeBoundBox(const treeBoundBox &)=default
Copy construct.
treeBoundBox subBbox(const point &mid, const direction) const
Sub-box given by octant number. Midpoint provided.
bool intersects(const point &start, const point &end, point &pt) const
Like above but does not return faces point is on.
direction posBits(const point &pt) const
Position of point relative to bounding box.
treeBoundBox(const UList< point > &points)
Construct as the bounding box of the given pointField.
treeBoundBox subHalf(const scalar mid, const direction whichFace) const
Sub-box half for given face with prescribed mid point value. Eg, subHalf(scalar, LEFT).
treeBoundBox & operator=(const treeBoundBox &)=default
Copy assignment.
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
List< edge > edgeList
List of edge.
bool operator!=(const eddy &a, const eddy &b)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< treeBoundBox > treeBoundBoxList
A List of treeBoundBox.
List< face > faceList
List of faces.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Istream & operator>>(Istream &, directionInfo &)
line< point, const point & > linePointRef
A line using referred points.
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.
UList< label > labelUList
A UList of labels.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
A template class to specify if a data type is composed solely of Foam::scalar elements.
A template class to specify that a data type can be considered as being contiguous in memory.