A bounding box defined in terms of the points at its extremities. More...
Public Member Functions | |
boundBox () | |
Construct null, setting points to zero. More... | |
boundBox (const point &min, const point &max) | |
Construct from components. More... | |
boundBox (const UList< point > &, const bool doReduce=true) | |
Construct as the bounding box of the given points. More... | |
boundBox (const tmp< pointField > &, const bool doReduce=true) | |
Construct as the bounding box of the given temporary pointField. More... | |
boundBox (const UList< point > &, const labelUList &indices, const bool doReduce=true) | |
Construct bounding box as subset of the pointField. More... | |
template<unsigned Size> | |
boundBox (const UList< point > &, const FixedList< label, Size > &indices, const bool doReduce=true) | |
Construct bounding box as subset of the pointField. More... | |
boundBox (Istream &) | |
Construct from Istream. More... | |
const point & | min () const |
Minimum describing the bounding box. More... | |
const point & | max () const |
Maximum describing the bounding box. More... | |
point & | min () |
Minimum describing the bounding box, non-const access. More... | |
point & | max () |
Maximum describing the bounding box, non-const access. More... | |
point | midpoint () const |
The midpoint of the bounding box. More... | |
vector | span () const |
The bounding box span (from minimum to maximum) More... | |
scalar | mag () const |
The magnitude of the bounding box span. More... | |
scalar | volume () const |
The volume of the bound box. More... | |
scalar | minDim () const |
Smallest length/height/width dimension. More... | |
scalar | maxDim () const |
Largest length/height/width dimension. More... | |
scalar | avgDim () const |
Average length/height/width dimension. More... | |
tmp< pointField > | points () const |
Return corner points in an order corresponding to a 'hex' cell. More... | |
void | inflate (const scalar s) |
Inflate box by factor*mag(span) in all dimensions. More... | |
bool | overlaps (const boundBox &) const |
Overlaps/touches boundingBox? More... | |
bool | overlaps (const point &, const scalar radiusSqr) const |
Overlaps boundingSphere (centre + sqr(radius))? More... | |
bool | contains (const point &) const |
Contains point? (inside or on edge) More... | |
bool | contains (const boundBox &) const |
Fully contains other boundingBox? More... | |
bool | containsInside (const point &) const |
Contains point? (inside only) More... | |
bool | contains (const UList< point > &) const |
Contains all of the points? (inside or on edge) More... | |
bool | contains (const UList< point > &, const labelUList &indices) const |
Contains all of the points? (inside or on edge) More... | |
template<unsigned Size> | |
bool | contains (const UList< point > &, const FixedList< label, Size > &indices) const |
Contains all of the points? (inside or on edge) More... | |
bool | containsAny (const UList< point > &) const |
Contains any of the points? (inside or on edge) More... | |
bool | containsAny (const UList< point > &, const labelUList &indices) const |
Contains any of the points? (inside or on edge) More... | |
template<unsigned Size> | |
bool | containsAny (const UList< point > &, const FixedList< label, Size > &indices) const |
Contains any of the points? (inside or on edge) More... | |
point | nearest (const point &) const |
Return the nearest point on the boundBox to the supplied point. More... | |
Static Public Member Functions | |
static faceList | faces () |
Return faces with correct point order. More... | |
Static Public Attributes | |
static const scalar | great |
The great value used for greatBox and invertedBox. More... | |
static const boundBox | greatBox |
A very large boundBox: min/max == -/+ VGREAT. More... | |
static const boundBox | invertedBox |
A very large inverted boundBox: min/max == +/- VGREAT. More... | |
Private Member Functions | |
void | calculate (const UList< point > &, const bool doReduce=true) |
Calculate the bounding box from the given points. More... | |
Private Attributes | |
point | min_ |
Minimum and maximum describing the bounding box. More... | |
point | max_ |
Friends | |
bool | operator== (const boundBox &, const boundBox &) |
bool | operator!= (const boundBox &, const boundBox &) |
Istream & | operator>> (Istream &, boundBox &) |
Ostream & | operator<< (Ostream &, const boundBox &) |
A bounding box defined in terms of the points at its extremities.
Definition at line 55 of file boundBox.H.
|
inline |
Construct null, setting points to zero.
Definition at line 32 of file boundBoxI.H.
Construct from components.
Definition at line 39 of file boundBoxI.H.
Construct as the bounding box of the given points.
Does parallel communication (doReduce = true)
Definition at line 88 of file boundBox.C.
References boundBox::calculate(), and boundBox::points().
boundBox | ( | const tmp< pointField > & | points, |
const bool | doReduce = true |
||
) |
Construct as the bounding box of the given temporary pointField.
Does parallel communication (doReduce = true)
Definition at line 97 of file boundBox.C.
References boundBox::calculate(), and boundBox::points().
boundBox | ( | const UList< point > & | points, |
const labelUList & | indices, | ||
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)
Definition at line 108 of file boundBox.C.
References UList::empty(), Foam::max(), Foam::min(), UPstream::parRun(), points, and Foam::reduce().
boundBox | ( | const UList< point > & | points, |
const FixedList< label, Size > & | 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)
Definition at line 35 of file boundBoxTemplates.C.
References Foam::max(), Foam::min(), points, and Foam::reduce().
Construct from Istream.
Definition at line 46 of file boundBoxI.H.
References Foam::operator>>().
Calculate the bounding box from the given points.
Does parallel communication (doReduce = true)
Definition at line 50 of file boundBox.C.
References Foam::max(), boundBox::max_, Foam::min(), boundBox::min_, UPstream::parRun(), boundBox::points(), Foam::reduce(), and Vector< scalar >::zero.
Referenced by boundBox::boundBox().
|
inline |
Minimum describing the bounding box.
Definition at line 54 of file boundBoxI.H.
Referenced by triSurfaceImportSurfaceAsSubset::addSurfaceAsSubset(), meshSurfaceMapper2D::adjustZCoordinates(), meshSearch::boundaryTree(), Foam::help::boundBoxLineIntersection(), triPoints::bounds(), tetPoints::bounds(), InteractionLists< typename CloudType::parcelType >::buildInteractionLists(), refinementFeatures::buildTrees(), meshToMesh0::calcAddressing(), treeDataPrimitivePatch< PatchType >::calcBb(), treeDataFace::calcBb(), PatchTools::calcBounds(), treeDataCell::calcCellBb(), meshToMesh::calcProcMap(), surfaceSlipDisplacementPointPatchVectorField::calcProjection(), surfaceDisplacementPointPatchVectorField::calcProjection(), patchCloudSet::calcSamples(), patchSeedSet::calcSamples(), faceHeatShading::calculate(), faceShading::calculate(), Foam::triSurfaceChecks::calculateBoundingBox(), pointToPointPlanarInterpolation::calcWeights(), meshSearch::cellTree(), polyMesh::cellTree(), Foam::triSurfaceChecks::checkCollocatedPoints(), Foam::checkGeometry(), Foam::triSurfaceChecks::checkOverlaps(), Foam::triSurfaceChecks::checkSelfIntersections(), Foam::checkTopology(), boundBox::contains(), polyMeshGen2DEngine::correctPoints(), AABBTree::createBoxes(), meshUntangler::cutRegion::createInitialConfiguration(), meshOctree::createInitialOctreeBox(), cartesianMeshExtractor::createPolyMesh(), triSurface2DCheck::createSubsets(), meshOctreeCubeCoordinates::cubeBox(), indexedOctree< Foam::treeDataFace >::divide(), dynamicIndexedOctree::divide(), triSurfaceMesh::edgeTree(), extendedEdgeMesh::edgeTree(), extendedEdgeMesh::edgeTreesByType(), treeBoundBox::extend(), triSurfaceExtrude2DEdges::extrudeSurface(), meshOctree::findEdgesInBox(), patchProbes::findElements(), findCellsIntersectingSurface::findIntersectedCells(), searchablePlate::findLine(), indexedOctree< Foam::treeDataFace >::findNear(), dynamicIndexedOctree::findNear(), dynamicTreeDataPoint::findNearest(), indexedOctree< Foam::treeDataFace >::findNearest(), meshSearch::findNearestBoundaryFace(), meshSearch::findNearestCellTree(), meshSearch::findNearestFaceTree(), mappedPatchBase::findSamples(), meshOctree::findTrianglesInBox(), polyMeshGen2DEngine::findZMaxPoints(), polyMeshGen2DEngine::findZMinPoints(), boundaryMesh::getNearest(), triangleFuncs::intersectBb(), treeDataTriSurface::intersects(), meshOctreeCubeCoordinates::intersectsLine(), lineRefinement::intersectsObject(), sphereRefinement::intersectsObject(), coneRefinement::intersectsObject(), hollowConeRefinement::intersectsObject(), meshOctreeCubeCoordinates::intersectsTriangle(), meshOctreeCubeCoordinates::intersectsTriangleExact(), triSurface2DCheck::is2DSurface(), meshOctreeCubeCoordinates::isVertexInside(), meshOctreeCube::leavesInBox(), main(), cellClassification::markFaces(), meshToMeshMethod::maskCells(), meshToMesh::maskCells(), sampledTriSurfaceMesh::nonCoupledboundaryTree(), volumeOptimizer::optimiseDivideAndConquer(), quadricMetric::optimizeNodePosition(), knuppMetric::optimizeNodePosition(), volumeOptimizer::optimizeNodePosition(), shellSurfaces::orient(), treeDataTriSurface::overlaps(), indexedOctree< Foam::treeDataFace >::overlaps(), searchablePlate::overlaps(), dynamicIndexedOctree::overlaps(), distributedTriSurfaceMesh::overlaps(), primitiveMesh::pointInCellBB(), extendedEdgeMesh::pointTree(), polyMeshGen2DEngine::polyMeshGen2DEngine(), procBounds(), indexedOctree< Foam::treeDataFace >::pushPointIntoFace(), dynamicIndexedOctree::pushPointIntoFace(), tetOverlapVolume::pyrBb(), meshOctreeCreator::refineBoxesContainedInObjects(), meshOctreeCreator::refineBoxesIntersectingEdgeMeshes(), meshOctreeCreator::refineBoxesIntersectingSurfaces(), refinementFeatures::regionEdgeTrees(), autoSnapDriver::reverseAttractMeshPoints(), searchableSurfaceCollection::searchableSurfaceCollection(), meshOctreeAutomaticRefinement::setMaxRefLevel(), meshOctreeCreator::setRootCubeSizeAndRefParameters(), simplexSmoother::simplexSmoother(), treeBoundBox::subBbox(), triSurfaceSearch::tree(), triSurfaceRegionSearch::treeByRegion(), sampledTriSurfaceMesh::update(), polyMeshGeometry::updateCellCentresAndVols(), meshOctreeCubeCoordinates::vertices(), topoSet::writeDebug(), triSurface::writeStats(), and distributedTriSurfaceMesh::writeStats().
|
inline |
Maximum describing the bounding box.
Definition at line 60 of file boundBoxI.H.
Referenced by triSurfaceImportSurfaceAsSubset::addSurfaceAsSubset(), meshSurfaceMapper2D::adjustZCoordinates(), meshSearch::boundaryTree(), Foam::help::boundBoxLineIntersection(), triPoints::bounds(), tetPoints::bounds(), InteractionLists< typename CloudType::parcelType >::buildInteractionLists(), refinementFeatures::buildTrees(), meshToMesh0::calcAddressing(), treeDataPrimitivePatch< PatchType >::calcBb(), treeDataFace::calcBb(), PatchTools::calcBounds(), treeDataCell::calcCellBb(), meshToMesh::calcProcMap(), surfaceSlipDisplacementPointPatchVectorField::calcProjection(), surfaceDisplacementPointPatchVectorField::calcProjection(), patchCloudSet::calcSamples(), patchSeedSet::calcSamples(), faceHeatShading::calculate(), faceShading::calculate(), Foam::triSurfaceChecks::calculateBoundingBox(), pointToPointPlanarInterpolation::calcWeights(), meshSearch::cellTree(), polyMesh::cellTree(), Foam::triSurfaceChecks::checkCollocatedPoints(), Foam::checkGeometry(), Foam::triSurfaceChecks::checkOverlaps(), Foam::triSurfaceChecks::checkSelfIntersections(), Foam::checkTopology(), boundBox::contains(), polyMeshGen2DEngine::correctPoints(), AABBTree::createBoxes(), meshUntangler::cutRegion::createInitialConfiguration(), meshOctree::createInitialOctreeBox(), cartesianMeshExtractor::createPolyMesh(), triSurface2DCheck::createSubsets(), meshOctreeCubeCoordinates::cubeBox(), indexedOctree< Foam::treeDataFace >::divide(), dynamicIndexedOctree::divide(), triSurfaceMesh::edgeTree(), extendedEdgeMesh::edgeTree(), extendedEdgeMesh::edgeTreesByType(), treeBoundBox::extend(), triSurfaceExtrude2DEdges::extrudeSurface(), meshOctree::findEdgesInBox(), patchProbes::findElements(), findCellsIntersectingSurface::findIntersectedCells(), searchablePlate::findLine(), indexedOctree< Foam::treeDataFace >::findNear(), dynamicIndexedOctree::findNear(), dynamicTreeDataPoint::findNearest(), indexedOctree< Foam::treeDataFace >::findNearest(), meshSearch::findNearestBoundaryFace(), meshSearch::findNearestCellTree(), meshSearch::findNearestFaceTree(), mappedPatchBase::findSamples(), meshOctree::findTrianglesInBox(), polyMeshGen2DEngine::findZMaxPoints(), polyMeshGen2DEngine::findZMinPoints(), boundaryMesh::getNearest(), triangleFuncs::intersectBb(), treeDataTriSurface::intersects(), meshOctreeCubeCoordinates::intersectsLine(), lineRefinement::intersectsObject(), sphereRefinement::intersectsObject(), coneRefinement::intersectsObject(), hollowConeRefinement::intersectsObject(), meshOctreeCubeCoordinates::intersectsTriangle(), meshOctreeCubeCoordinates::intersectsTriangleExact(), triSurface2DCheck::is2DSurface(), meshOctreeCubeCoordinates::isVertexInside(), Kmesh::Kmesh(), meshOctreeCube::leavesInBox(), main(), cellClassification::markFaces(), meshToMeshMethod::maskCells(), meshToMesh::maskCells(), sampledTriSurfaceMesh::nonCoupledboundaryTree(), volumeOptimizer::optimiseDivideAndConquer(), quadricMetric::optimizeNodePosition(), volumeOptimizer::optimizeNodePosition(), knuppMetric::optimizeNodePosition(), shellSurfaces::orient(), orientedSurface::orientedSurface(), treeDataTriSurface::overlaps(), indexedOctree< Foam::treeDataFace >::overlaps(), searchablePlate::overlaps(), dynamicIndexedOctree::overlaps(), distributedTriSurfaceMesh::overlaps(), primitiveMesh::pointInCellBB(), extendedEdgeMesh::pointTree(), polyMeshGen2DEngine::polyMeshGen2DEngine(), procBounds(), indexedOctree< Foam::treeDataFace >::pushPointIntoFace(), dynamicIndexedOctree::pushPointIntoFace(), tetOverlapVolume::pyrBb(), meshOctreeCreator::refineBoxesContainedInObjects(), meshOctreeCreator::refineBoxesIntersectingEdgeMeshes(), meshOctreeCreator::refineBoxesIntersectingSurfaces(), refinementFeatures::regionEdgeTrees(), autoSnapDriver::reverseAttractMeshPoints(), searchableSurfaceCollection::searchableSurfaceCollection(), meshOctreeAutomaticRefinement::setMaxRefLevel(), meshOctreeCreator::setRootCubeSizeAndRefParameters(), simplexSmoother::simplexSmoother(), treeBoundBox::subBbox(), triSurfaceSearch::tree(), triSurfaceRegionSearch::treeByRegion(), sampledTriSurfaceMesh::update(), polyMeshGeometry::updateCellCentresAndVols(), meshOctreeCubeCoordinates::vertices(), topoSet::writeDebug(), triSurface::writeStats(), and distributedTriSurfaceMesh::writeStats().
|
inline |
Minimum describing the bounding box, non-const access.
|
inline |
Maximum describing the bounding box, non-const access.
|
inline |
The midpoint of the bounding box.
Definition at line 78 of file boundBoxI.H.
Referenced by indexedOctree< Foam::treeDataFace >::calcVolumeType(), dynamicIndexedOctree::calcVolumeType(), and pointToPointPlanarInterpolation::calcWeights().
|
inline |
The bounding box span (from minimum to maximum)
Definition at line 84 of file boundBoxI.H.
Referenced by booleanSurface::booleanSurface(), blockMesh::calcMergeInfo(), blockMesh::calcMergeInfoFast(), Foam::checkGeometry(), AMIMethod< SourcePatch, TargetPatch >::checkPatches(), AABBTree::createBoxes(), treeBoundBox::extend(), findCellsIntersectingSurface::findIntersectedCells(), mappedPatchBase::findSamples(), treeDataTriSurface::getVolumeType(), Kmesh::Kmesh(), main(), shellSurfaces::orient(), orientedSurface::orientedSurface(), primitiveMesh::pointInCellBB(), meshOctreeCreator::refineBoxesIntersectingEdgeMeshes(), meshOctreeCreator::refineBoxesIntersectingSurfaces(), sampledTriSurfaceMesh::update(), and displacementMotionSolver::updateMesh().
|
inline |
The magnitude of the bounding box span.
Definition at line 90 of file boundBoxI.H.
References Foam::mag().
Referenced by meshToMesh0::calcAddressing(), searchableSurfaces::checkSizes(), triSurfaceExtrude2DEdges::extrudeSurface(), patchProbes::findElements(), getMergeDistance(), isoSurfaceCell::isoSurfaceCell(), knuppMetric::knuppMetric(), main(), volumeOptimizer::optimizeNodePosition(), and sampledSurfaces::update().
|
inline |
The volume of the bound box.
Definition at line 96 of file boundBoxI.H.
References Foam::cmptProduct().
|
inline |
Smallest length/height/width dimension.
Definition at line 102 of file boundBoxI.H.
References Foam::cmptMin().
Referenced by edgeIntersections::checkEdges(), and main().
|
inline |
Largest length/height/width dimension.
Definition at line 108 of file boundBoxI.H.
References Foam::cmptMax().
|
inline |
Average length/height/width dimension.
Definition at line 114 of file boundBoxI.H.
References Foam::cmptAv().
Referenced by meshToMesh0::calcAddressing(), boundaryMesh::getNearest(), and cellClassification::markFaces().
Foam::tmp< Foam::pointField > points | ( | ) | const |
Return corner points in an order corresponding to a 'hex' cell.
Definition at line 149 of file boundBox.C.
Referenced by boundBox::boundBox(), boundBox::calculate(), targetVolumeToCell::combine(), and searchableRotatedBox::overlaps().
|
static |
Return faces with correct point order.
Definition at line 167 of file boundBox.C.
References forAll, and List::setSize().
void inflate | ( | const scalar | s | ) |
Inflate box by factor*mag(span) in all dimensions.
Definition at line 210 of file boundBox.C.
References Foam::mag(), Vector< scalar >::one, and s().
Referenced by AMIMethod< SourcePatch, TargetPatch >::checkPatches(), AABBTree::createBoxes(), meshToMeshMethod::maskCells(), meshToMesh::maskCells(), surfaceFeatures::nearestFeatEdge(), surfaceFeatures::nearestSurfEdge(), AMIMethod< SourcePatch, TargetPatch >::resetTree(), and sampledTriSurfaceMesh::update().
|
inline |
Overlaps/touches boundingBox?
Definition at line 120 of file boundBoxI.H.
References boundBox::max_, boundBox::min_, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by findCellsIntersectingSurface::findIntersectedCells(), boxRefinement::intersectsObject(), meshOctreeCube::leavesInBox(), meshToMeshMethod::maskCells(), meshToMesh::maskCells(), searchableRotatedBox::overlaps(), searchableBox::overlaps(), searchableSphere::overlaps(), and interRegionOption::setMapper().
|
inline |
Overlaps boundingSphere (centre + sqr(radius))?
Definition at line 132 of file boundBoxI.H.
References Foam::mag(), and VectorSpace< Vector< scalar >, scalar, 3 >::nComponents.
|
inline |
Contains point? (inside or on edge)
Definition at line 170 of file boundBoxI.H.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Referenced by Foam::help::boundBoxLineIntersection(), AMIMethod< SourcePatch, TargetPatch >::checkPatches(), findCellsIntersectingSurface::findIntersectedCells(), quadricMetric::optimizeNodePosition(), volumeOptimizer::optimizeNodePosition(), knuppMetric::optimizeNodePosition(), primitiveMesh::pointInCellBB(), and polyMeshGeometry::updateCellCentresAndVols().
|
inline |
Fully contains other boundingBox?
Definition at line 182 of file boundBoxI.H.
References boundBox::max(), and boundBox::min().
|
inline |
Contains point? (inside only)
Definition at line 188 of file boundBoxI.H.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
Contains all of the points? (inside or on edge)
Definition at line 219 of file boundBox.C.
bool contains | ( | const UList< point > & | points, |
const labelUList & | indices | ||
) | const |
Contains all of the points? (inside or on edge)
Definition at line 239 of file boundBox.C.
References UList::empty(), forAll, and points.
Contains all of the points? (inside or on edge)
Definition at line 79 of file boundBoxTemplates.C.
Contains any of the points? (inside or on edge)
Definition at line 261 of file boundBox.C.
References forAll, and points.
Referenced by searchableRotatedBox::overlaps(), treeDataFace::overlaps(), and treeDataPrimitivePatch< PatchType >::overlaps().
bool containsAny | ( | const UList< point > & | points, |
const labelUList & | indices | ||
) | const |
Contains any of the points? (inside or on edge)
Definition at line 281 of file boundBox.C.
References UList::empty(), forAll, and points.
Contains any of the points? (inside or on edge)
Definition at line 104 of file boundBoxTemplates.C.
Foam::point nearest | ( | const point & | pt | ) | const |
Return the nearest point on the boundBox to the supplied point.
If point is inside the boundBox then the point is returned unchanged.
Definition at line 303 of file boundBox.C.
References Foam::max(), Foam::min(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
private |
Minimum and maximum describing the bounding box.
Definition at line 60 of file boundBox.H.
Referenced by boundBox::calculate(), Foam::operator<<(), Foam::operator>>(), and boundBox::overlaps().
|
private |
Definition at line 60 of file boundBox.H.
Referenced by boundBox::calculate(), Foam::operator<<(), Foam::operator>>(), and boundBox::overlaps().
|
static |
The great value used for greatBox and invertedBox.
Definition at line 73 of file boundBox.H.
|
static |
A very large boundBox: min/max == -/+ VGREAT.
Definition at line 76 of file boundBox.H.
Referenced by isoSurface::isoSurface(), isoSurfaceCell::isoSurfaceCell(), streamLineBase::read(), and streamLineBase::write().
|
static |
A very large inverted boundBox: min/max == +/- VGREAT.
Definition at line 79 of file boundBox.H.
Referenced by PatchTools::calcBounds(), shellSurfaces::orient(), procBounds(), and triSurface::writeStats().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.