1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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
26 Foam::fileFormats::STLsurfaceFormatCore
29 Internal class used by the STLsurfaceFormat
32 STLsurfaceFormatCore.C
33 STLsurfaceFormatASCII.L
35 \*---------------------------------------------------------------------------*/
37 #ifndef STLsurfaceFormatCore_H
38 #define STLsurfaceFormatCore_H
40 #include "STLtriangle.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class STLsurfaceFormatCore Declaration
54 \*---------------------------------------------------------------------------*/
56 class STLsurfaceFormatCore
62 //- The points supporting the facets
65 //- The zones associated with the faces
68 //- The solid names, in the order of their first appearance
71 //- The solid count, in the order of their first appearance
75 // Private Member Functions
77 //- Disallow default bitwise copy construct
78 STLsurfaceFormatCore(const STLsurfaceFormatCore&);
80 //- Disallow default bitwise assignment
81 void operator=(const STLsurfaceFormatCore&);
83 //- Determine the file type
84 static int detectBINARY(const fileName&);
87 bool readASCII(istream&, const off_t);
90 bool readBINARY(istream&, const off_t);
97 //- The number of bytes in the STL binary header
98 static const unsigned int headerSize = 80;
101 // Static Member Functions
103 //- Write "STL binary file" and number of triangles to stream
104 static void writeHeaderBINARY(ostream&, unsigned int);
109 //- Read from file, filling in the information
110 STLsurfaceFormatCore(const fileName&);
115 ~STLsurfaceFormatCore();
120 //- File read was already sorted
136 //- Return full access to the points
142 //- Return full access to the zoneIds
143 List<label>& zoneIds()
148 //- The list of solid names in the order of their first appearance
154 //- The list of solid sizes in the order of their first appearance
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace fileFormats
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 // ************************************************************************* //