/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2023 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 . \*---------------------------------------------------------------------------*/ #include "treeDataPrimitivePatch.H" #include "indexedOctree.H" #include "triangleFuncs.H" #include "triSurfaceTools.H" #include "triFace.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template Foam::treeBoundBox Foam::treeDataPrimitivePatch::calcBb ( const pointField& points, const face& f ) { treeBoundBox bb(points[f[0]], points[f[0]]); for (label fp = 1; fp < f.size(); fp++) { const point& p = points[f[fp]]; bb.min() = min(bb.min(), p); bb.max() = max(bb.max(), p); } return bb; } template void Foam::treeDataPrimitivePatch::update() { if (cacheBb_) { bbs_.setSize(patch_.size()); forAll(patch_, i) { bbs_[i] = calcBb(patch_.points(), patch_[i]); } } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components template Foam::treeDataPrimitivePatch::treeDataPrimitivePatch ( const bool cacheBb, const PatchType& patch, const scalar planarTol ) : patch_(patch), cacheBb_(cacheBb), planarTol_(planarTol) { update(); } template Foam::treeDataPrimitivePatch::findNearestOp::findNearestOp ( const indexedOctree>& tree ) : tree_(tree) {} template Foam::treeDataPrimitivePatch::findIntersectOp::findIntersectOp ( const indexedOctree>& tree ) : tree_(tree) {} template Foam::treeDataPrimitivePatch::findAllIntersectOp::findAllIntersectOp ( const indexedOctree>& tree, DynamicList