initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / searchableSurface / searchablePlane.H
blob87777e3209bc6763b1e8cd155eb55ce4f3f7c4e1
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 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
19     for more details.
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
25 Class
26     Foam::searchablePlane
28 Description
29     Searching on plane. See plane.H
31 SourceFiles
32     searchablePlane.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef searchablePlane_H
37 #define searchablePlane_H
39 #include "searchableSurface.H"
40 #include "plane.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 // Forward declaration of classes
49 /*---------------------------------------------------------------------------*\
50                            Class searchablePlane Declaration
51 \*---------------------------------------------------------------------------*/
53 class searchablePlane
55     public searchableSurface,
56     public plane
58 private:
60     // Private Member Data
62         mutable wordList regions_;
65     // Private Member Functions
67         pointIndexHit findLine
68         (
69             const point& start,
70             const point& end
71         ) const;
74         //- Disallow default bitwise copy construct
75         searchablePlane(const searchablePlane&);
77         //- Disallow default bitwise assignment
78         void operator=(const searchablePlane&);
81 public:
83     //- Runtime type information
84     TypeName("searchablePlane");
87     // Constructors
89         //- Construct from components
90         searchablePlane
91         (
92             const IOobject& io,
93             const point& basePoint,
94             const vector& normal
95         );
97         //- Construct from dictionary (used by searchableSurface)
98         searchablePlane
99         (
100             const IOobject& io,
101             const dictionary& dict
102         );
104     // Destructor
106         virtual ~searchablePlane();
109     // Member Functions
111         virtual const wordList& regions() const;
113         //- Whether supports volume type below
114         virtual bool hasVolumeType() const
115         {
116             return false;
117         }
119         //- Range of local indices that can be returned.
120         virtual label size() const
121         {
122             return 1;
123         }
126         // Multiple point queries.
128             virtual void findNearest
129             (
130                 const pointField& sample,
131                 const scalarField& nearestDistSqr,
132                 List<pointIndexHit>&
133             ) const;
135             virtual void findLine
136             (
137                 const pointField& start,
138                 const pointField& end,
139                 List<pointIndexHit>&
140             ) const;
142             virtual void findLineAny
143             (
144                 const pointField& start,
145                 const pointField& end,
146                 List<pointIndexHit>&
147             ) const;
149             //- Get all intersections in order from start to end.
150             virtual void findLineAll
151             (
152                 const pointField& start,
153                 const pointField& end,
154                 List<List<pointIndexHit> >&
155             ) const;
157             //- From a set of points and indices get the region
158             virtual void getRegion
159             (
160                 const List<pointIndexHit>&,
161                 labelList& region
162             ) const;
164             //- From a set of points and indices get the normal
165             virtual void getNormal
166             (
167                 const List<pointIndexHit>&,
168                 vectorField& normal
169             ) const;
171             //- Determine type (inside/outside/mixed) for point. unknown if
172             //  cannot be determined (e.g. non-manifold surface)
173             virtual void getVolumeType
174             (
175                 const pointField&,
176                 List<volumeType>&
177             ) const;
180         // regIOobject implementation
182             bool writeData(Ostream&) const
183             {
184                 notImplemented("searchablePlane::writeData(Ostream&) const");
185                 return false;
186             }
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 } // End namespace Foam
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #endif
199 // ************************************************************************* //