Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / meshTools / searchableSurface / searchablePlane.H
blob6248b77d385ff5d764f59b28cee8f7be3052ba37
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     Foam::searchablePlane
27 Description
28     Searching on (infinite) plane. See plane.H
30 SourceFiles
31     searchablePlane.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef searchablePlane_H
36 #define searchablePlane_H
38 #include "searchableSurface.H"
39 #include "plane.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 // Forward declaration of classes
48 /*---------------------------------------------------------------------------*\
49                            Class searchablePlane Declaration
50 \*---------------------------------------------------------------------------*/
52 class searchablePlane
54     public searchableSurface,
55     public plane
57 private:
59     // Private Member Data
61         mutable wordList regions_;
64     // Private Member Functions
66         pointIndexHit findLine
67         (
68             const point& start,
69             const point& end
70         ) const;
73         //- Disallow default bitwise copy construct
74         searchablePlane(const searchablePlane&);
76         //- Disallow default bitwise assignment
77         void operator=(const searchablePlane&);
80 public:
82     //- Runtime type information
83     TypeName("searchablePlane");
86     // Constructors
88         //- Construct from components
89         searchablePlane
90         (
91             const IOobject& io,
92             const point& basePoint,
93             const vector& normal
94         );
96         //- Construct from dictionary (used by searchableSurface)
97         searchablePlane
98         (
99             const IOobject& io,
100             const dictionary& dict
101         );
103     // Destructor
105         virtual ~searchablePlane();
108     // Member Functions
110         virtual const wordList& regions() const;
112         //- Whether supports volume type below
113         virtual bool hasVolumeType() const
114         {
115             return false;
116         }
118         //- Range of local indices that can be returned.
119         virtual label size() const
120         {
121             return 1;
122         }
124         //- Get representative set of element coordinates
125         //  Usually the element centres (should be of length size()).
126         virtual pointField coordinates() const
127         {
128             //notImplemented("searchablePlane::coordinates()")
129             return pointField(1, refPoint());
130         }
133         // Multiple point queries.
135             virtual void findNearest
136             (
137                 const pointField& sample,
138                 const scalarField& nearestDistSqr,
139                 List<pointIndexHit>&
140             ) const;
142             virtual void findLine
143             (
144                 const pointField& start,
145                 const pointField& end,
146                 List<pointIndexHit>&
147             ) const;
149             virtual void findLineAny
150             (
151                 const pointField& start,
152                 const pointField& end,
153                 List<pointIndexHit>&
154             ) const;
156             //- Get all intersections in order from start to end.
157             virtual void findLineAll
158             (
159                 const pointField& start,
160                 const pointField& end,
161                 List<List<pointIndexHit> >&
162             ) const;
164             //- From a set of points and indices get the region
165             virtual void getRegion
166             (
167                 const List<pointIndexHit>&,
168                 labelList& region
169             ) const;
171             //- From a set of points and indices get the normal
172             virtual void getNormal
173             (
174                 const List<pointIndexHit>&,
175                 vectorField& normal
176             ) const;
178             //- Determine type (inside/outside/mixed) for point. unknown if
179             //  cannot be determined (e.g. non-manifold surface)
180             virtual void getVolumeType
181             (
182                 const pointField&,
183                 List<volumeType>&
184             ) const;
187         // regIOobject implementation
189             bool writeData(Ostream&) const
190             {
191                 notImplemented("searchablePlane::writeData(Ostream&) const");
192                 return false;
193             }
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 } // End namespace Foam
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 #endif
206 // ************************************************************************* //