1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Holds (reference to) pointField. Encapsulation of data needed for
30 Used for searching for nearest point. No bounding boxes around points.
31 Only overlaps and calcNearest are implemented, rest makes little sense.
36 \*---------------------------------------------------------------------------*/
38 #ifndef treeDataPoint_H
39 #define treeDataPoint_H
41 #include "pointField.H"
42 #include "treeBoundBox.H"
43 #include "linePointRef.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
51 template<class Type> class indexedOctree;
53 /*---------------------------------------------------------------------------*\
54 Class treeDataPoint Declaration
55 \*---------------------------------------------------------------------------*/
61 const pointField& points_;
65 // Declare name of the class and its debug switch
66 ClassName("treeDataPoint");
71 //- Construct from components. Holds reference to points!
72 treeDataPoint(const pointField& points);
81 return points_.size();
84 //- Get representative point cloud for all shapes inside
85 // (one point per shape)
86 pointField points() const;
91 //- Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
92 // Only makes sense for closed surfaces.
95 const indexedOctree<treeDataPoint>&,
99 //- Does (bb of) shape at index overlap bb
103 const treeBoundBox& sampleBb
106 //- Calculates nearest (to sample) point in shape.
107 // Returns actual point and distance (squared)
110 const labelList& indices,
113 scalar& nearestDistSqr,
118 //- Calculates nearest (to line) point in shape.
119 // Returns point and distance (squared)
122 const labelList& indices,
123 const linePointRef& ln,
125 treeBoundBox& tightest,
131 //- Calculate intersection of shape with ray. Sets result
143 "treeDataPoint::intersects(const label, const point&,"
144 "const point&, point&)"
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //