1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
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
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/>.
28 Contains information about location on a triSurface:
32 - index (of triangle/point/edge)
34 - what index above relates to. In triangle::proxType
40 \*---------------------------------------------------------------------------*/
42 #ifndef surfaceLocation_H
43 #define surfaceLocation_H
45 #include "pointIndexHit.H"
46 #include "triPointRef.H"
47 #include "InfoProxy.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Forward declaration of classes
57 /*---------------------------------------------------------------------------*\
58 Class surfaceLocation Declaration
59 \*---------------------------------------------------------------------------*/
67 triPointRef::proxType elementType_;
80 elementType_(triPointRef::NONE),
84 //- Construct from components
87 const pointIndexHit& pih,
88 const triPointRef::proxType elementType,
93 elementType_(elementType),
97 //- Construct from Istream
98 surfaceLocation(Istream& is)
101 elementType_(triPointRef::proxType(readLabel(is))),
102 triangle_(readLabel(is))
108 triPointRef::proxType& elementType()
113 triPointRef::proxType elementType() const
123 label triangle() const
128 //- Normal. Approximate for points.
129 vector normal(const triSurface& s) const;
131 //- Return info proxy.
132 // Used to print token information to a stream
133 InfoProxy<surfaceLocation> info() const
139 void write(Ostream& os, const triSurface& s) const;
142 // IOstream Operators
144 friend Istream& operator>>(Istream& is, surfaceLocation& sl);
146 friend Ostream& operator<<(Ostream& os, const surfaceLocation& sl);
148 friend Ostream& operator<<
151 const InfoProxy<surfaceLocation>&
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 // ************************************************************************* //