meshOctreeCubeIntersections.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "triSurf.H"
29 #include "meshOctreeCube.H"
30 #include "VRWGraph.H"
31 #include "helperFunctions.H"
32 
33 //#define DEBUGSearch
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
43 (
44  const triSurf& surface,
45  const boundBox& rootBox,
46  const VRWGraph& containedElements
47 ) const
48 {
49  if( containedElementsLabel_ == -1 )
50  return false;
51 
52  forAllRow(containedElements, containedElementsLabel_, tI)
53  if(
54  intersectsTriangleExact
55  (
56  surface,
57  rootBox,
58  containedElements(containedElementsLabel_, tI)
59  )
60  )
61  return true;
62 
63  return false;
64 }
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 } // End namespace Foam
69 
70 // ************************************************************************* //
triSurf.H
VRWGraph.H
meshOctreeCube.H
forAllRow
#define forAllRow(graph, rowI, index)
Definition: VRWGraph.H:277
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
helperFunctions.H
Foam::surface
Definition: surface.H:55
Foam::boundBox
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:55
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::triSurf
Definition: triSurf.H:59
Foam::meshOctreeCube::hasContainedTriangles
bool hasContainedTriangles(const triSurf &, const boundBox &, const VRWGraph &containedElements) const
check if this box has some contained triangles
Definition: meshOctreeCubeIntersections.C:43