ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / meshTools / searchableSurface / searchablePlane.H
blobac7b59b00b960676015e396c50d44e5e0bdf946d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  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
104     virtual ~searchablePlane();
107     // Member Functions
109         virtual const wordList& regions() const;
111         //- Whether supports volume type below
112         virtual bool hasVolumeType() const
113         {
114             return false;
115         }
117         //- Range of local indices that can be returned.
118         virtual label size() const
119         {
120             return 1;
121         }
123         //- Get representative set of element coordinates
124         //  Usually the element centres (should be of length size()).
125         virtual pointField coordinates() const
126         {
127             //notImplemented("searchablePlane::coordinates()")
128             return pointField(1, refPoint());
129         }
132         // Multiple point queries.
134             virtual void findNearest
135             (
136                 const pointField& sample,
137                 const scalarField& nearestDistSqr,
138                 List<pointIndexHit>&
139             ) const;
141             virtual void findLine
142             (
143                 const pointField& start,
144                 const pointField& end,
145                 List<pointIndexHit>&
146             ) const;
148             virtual void findLineAny
149             (
150                 const pointField& start,
151                 const pointField& end,
152                 List<pointIndexHit>&
153             ) const;
155             //- Get all intersections in order from start to end.
156             virtual void findLineAll
157             (
158                 const pointField& start,
159                 const pointField& end,
160                 List<List<pointIndexHit> >&
161             ) const;
163             //- From a set of points and indices get the region
164             virtual void getRegion
165             (
166                 const List<pointIndexHit>&,
167                 labelList& region
168             ) const;
170             //- From a set of points and indices get the normal
171             virtual void getNormal
172             (
173                 const List<pointIndexHit>&,
174                 vectorField& normal
175             ) const;
177             //- Determine type (inside/outside/mixed) for point. unknown if
178             //  cannot be determined (e.g. non-manifold surface)
179             virtual void getVolumeType
180             (
181                 const pointField&,
182                 List<volumeType>&
183             ) const;
186         // regIOobject implementation
188             bool writeData(Ostream&) const
189             {
190                 notImplemented("searchablePlane::writeData(Ostream&) const");
191                 return false;
192             }
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 } // End namespace Foam
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 #endif
205 // ************************************************************************* //