/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
Class
Foam::boundBox
Description
A bounding box defined in terms of the points at its extremities.
\*---------------------------------------------------------------------------*/
#ifndef boundBox_H
#define boundBox_H
#include "pointField.H"
#include "faceList.H"
#include "scalable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
class boundBox;
template class tmp;
bool operator==(const boundBox&, const boundBox&);
bool operator!=(const boundBox&, const boundBox&);
Istream& operator>>(Istream&, boundBox&);
Ostream& operator<<(Ostream&, const boundBox&);
/*---------------------------------------------------------------------------*\
Class boundBox Declaration
\*---------------------------------------------------------------------------*/
class boundBox
{
// Private Data
//- Minimum and maximum describing the bounding box
point min_, max_;
// Private Member Functions
//- Calculate the bounding box from the given points.
// Does parallel communication (doReduce = true)
void calculate(const UList&, const bool doReduce = true);
public:
// Static Data Members
//- A very large boundBox: min/max == -/+ vGreat
static const boundBox greatBox;
//- A very large inverted boundBox: min/max == +/- vGreat
static const boundBox invertedBox;
// Static Member Functions
//- Does the dictionary have a bound box specified in it?
inline static bool found(const dictionary& dict);
// Constructors
//- Construct null, setting points to zero
inline boundBox();
//- Construct from components
inline boundBox(const point& min, const point& max);
//- Construct as the bounding box of the given points
// Does parallel communication (doReduce = true)
boundBox(const UList&, const bool doReduce = true);
//- Construct as the bounding box of the given temporary pointField.
// Does parallel communication (doReduce = true)
boundBox(const tmp&, const bool doReduce = true);
//- Construct bounding box as subset of the pointField.
// The indices could be from cell/face etc.
// Does parallel communication (doReduce = true)
boundBox
(
const UList&,
const labelUList& indices,
const bool doReduce = true
);
//- Construct bounding box as subset of the pointField.
// The indices could be from edge/triFace etc.
// Does parallel communication (doReduce = true)
template
boundBox
(
const UList&,
const FixedList