FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

TRIsurfaceFormatCore.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::fileFormats::TRIsurfaceFormatCore
00026 
00027 Description
00028     Internal class used by the TRIsurfaceFormat
00029 
00030 SourceFiles
00031     TRIsurfaceFormatCore.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef TRIsurfaceFormatCore_H
00036 #define TRIsurfaceFormatCore_H
00037 
00038 #include <surfMesh/surfaceFormatsCore.H>
00039 #include <OpenFOAM/triFace.H>
00040 
00041 #include <OpenFOAM/IFstream.H>
00042 #include <OpenFOAM/Ostream.H>
00043 #include <OpenFOAM/OFstream.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 namespace fileFormats
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053                     Class TRIsurfaceFormatCore Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class TRIsurfaceFormatCore
00057 :
00058     public surfaceFormatsCore
00059 {
00060     // Private Data
00061 
00062         bool sorted_;
00063 
00064         //- The points supporting the facets
00065         pointField points_;
00066 
00067         //- The zones associated with the faces
00068         List<label> zoneIds_;
00069 
00070         //- The solid count, in the order of their first appearance
00071         List<label> sizes_;
00072 
00073 
00074     // Private Member Functions
00075 
00076         //- Disallow default bitwise copy construct
00077         TRIsurfaceFormatCore(const TRIsurfaceFormatCore&);
00078 
00079         //- Disallow default bitwise assignment
00080         void operator=(const TRIsurfaceFormatCore&);
00081 
00082         bool read(const fileName&);
00083 
00084 
00085 public:
00086 
00087     // Constructors
00088 
00089         //- Read from file, filling in the information
00090         TRIsurfaceFormatCore(const fileName&);
00091 
00092 
00093     // Destructor
00094 
00095         ~TRIsurfaceFormatCore();
00096 
00097 
00098     // Member Functions
00099 
00100         //- File read was already sorted
00101         bool sorted() const
00102         {
00103             return sorted_;
00104         }
00105 
00106         //- Flush all values
00107         void clear()
00108         {
00109             sorted_ = true;
00110             points_.clear();
00111             zoneIds_.clear();
00112             sizes_.clear();
00113         }
00114 
00115         //- Return full access to the points
00116         pointField& points()
00117         {
00118             return points_;
00119         }
00120 
00121         //- Return full access to the zones
00122         List<label>& zoneIds()
00123         {
00124             return zoneIds_;
00125         }
00126 
00127         //- The list of zone sizes in the order of their first appearance
00128         List<label>& sizes()
00129         {
00130             return sizes_;
00131         }
00132 };
00133 
00134 
00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00136 
00137 } // End namespace fileFormats
00138 } // End namespace Foam
00139 
00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00141 
00142 #endif
00143 
00144 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines