initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / triSurface / triSurface / interfaces / STL / STLtriangle.H
blob6cf20195e2d10e7562f8bdd7e210b1742ccd895c
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::STLtriangle
28 Description
29     A triangle representation for STL files.
31 SourceFiles
32     STLtriangleI.H
34 \*---------------------------------------------------------------------------*/
36 #ifndef STLtriangle_H
37 #define STLtriangle_H
39 #include "STLpoint.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class STLtriangle Declaration
48 \*---------------------------------------------------------------------------*/
50 class STLtriangle
52     // Private data
54         STLpoint normal_, a_, b_, c_;
55         unsigned short region_;
58 public:
60     // Constructors
62         //- Construct null
63         inline STLtriangle();
65         //- Construct from components
66         inline STLtriangle
67         (
68             const STLpoint& normal,
69             const STLpoint& a,
70             const STLpoint& b,
71             const STLpoint& c,
72             unsigned short region
73         );
75         //- Construct from istream (read binary)
76         inline STLtriangle(istream&);
79     // Member Functions
81         // Access
83             inline const STLpoint& a() const;
84             inline const STLpoint& b() const;
85             inline const STLpoint& c() const;
86             inline unsigned short region() const;
88         // Read
90             //- Read from istream (binary)
91             inline void read(istream&);
93         // Write
95             //- Write to istream (binary)
96             inline void write(ostream&);
99     // Ostream operator
101         inline friend Ostream& operator<<(Ostream&, const STLtriangle&);
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 } // End namespace Foam
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 #include "STLtriangleI.H"
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 #endif
117 // ************************************************************************* //