1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 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
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
29 Contains information about location on a triSurface:
34 - index (of triangle/point/edge)
36 - what index above relates to. In triangle::proxType
42 \*---------------------------------------------------------------------------*/
44 #ifndef surfaceLocation_H
45 #define surfaceLocation_H
47 #include "pointIndexHit.H"
48 #include "triPointRef.H"
49 #include "InfoProxy.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Forward declaration of classes
59 /*---------------------------------------------------------------------------*\
60 Class surfaceLocation Declaration
61 \*---------------------------------------------------------------------------*/
69 triPointRef::proxType elementType_;
82 elementType_(triPointRef::NONE),
86 //- Construct from components
89 const pointIndexHit& pih,
90 const triPointRef::proxType elementType,
95 elementType_(elementType),
99 //- Construct from Istream
100 surfaceLocation(Istream& is)
103 elementType_(triPointRef::proxType(readLabel(is))),
104 triangle_(readLabel(is))
110 triPointRef::proxType& elementType()
115 triPointRef::proxType elementType() const
125 label triangle() const
130 //- Normal. Approximate for points.
131 vector normal(const triSurface& s) const;
133 //- Return info proxy.
134 // Used to print token information to a stream
135 InfoProxy<surfaceLocation> info() const
141 void write(Ostream& os, const triSurface& s) const;
144 // IOstream Operators
146 friend Istream& operator>>(Istream& is, surfaceLocation& sl);
148 friend Ostream& operator<<(Ostream& os, const surfaceLocation& sl);
150 friend Ostream& operator<<
153 const InfoProxy<surfaceLocation>&
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 // ************************************************************************* //