1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM 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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::treeDataTriSurface
29 Encapsulates data for (indexedOc)tree searches on triSurface.
34 \*---------------------------------------------------------------------------*/
36 #ifndef treeDataTriSurface_H
37 #define treeDataTriSurface_H
39 #include "triSurface.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of classes
48 class treeDataTriSurface;
49 template<class Type> class indexedOctree;
51 /*---------------------------------------------------------------------------*\
52 Class treeDataTriSurface Declaration
53 \*---------------------------------------------------------------------------*/
55 class treeDataTriSurface
59 const triSurface& surface_;
62 // Private Member Functions
64 //- fast triangle nearest point calculation. Returns point in E0, E1
65 // coordinate system: base + s*E0 + t*E1
66 static scalar nearestCoords
81 // Declare name of the class and its debug switch
82 ClassName("treeDataTriSurface");
87 //- Construct from triSurface. Holds reference.
88 treeDataTriSurface(const triSurface&);
95 const triSurface& surface() const
102 return surface_.size();
105 //- Get representative point cloud for all shapes inside
106 // (one point per shape)
107 pointField points() const;
112 //- Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
113 // Only makes sense for closed surfaces.
116 const indexedOctree<treeDataTriSurface>&,
120 //- Does (bb of) shape at index overlap bb
124 const treeBoundBox& sampleBb
127 //- Calculates nearest (to sample) point in shape.
128 // Returns actual point and distance (squared)
131 const labelList& indices,
134 scalar& nearestDistSqr,
139 //- Calculates nearest (to line) point in shape.
140 // Returns point and distance (squared)
143 const labelList& indices,
144 const linePointRef& ln,
146 treeBoundBox& tightest,
152 //- Calculate intersection of triangle with ray. Sets result
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 // ************************************************************************* //