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

OFFsurfaceFormat.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::OFFsurfaceFormat
00026 
00027 Description
00028     Provide a means of reading/writing Geomview OFF polyList format.
00029 
00030 
00031 See Also
00032     The <a href="http://www.geoview.org">Geoview</a>
00033     file format information:
00034     http://www.geomview.org/docs/html/OFF.html#OFF
00035 
00036 Note
00037     When reading, the optional @a colorspec is ignored.
00038     When writing, it is set to the zone number (integer).
00039 
00040 SourceFiles
00041     OFFsurfaceFormat.C
00042 
00043 \*---------------------------------------------------------------------------*/
00044 
00045 #ifndef OFFsurfaceFormat_H
00046 #define OFFsurfaceFormat_H
00047 
00048 #include <surfMesh/MeshedSurface.H>
00049 #include <surfMesh/MeshedSurfaceProxy.H>
00050 #include <surfMesh/UnsortedMeshedSurface.H>
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 namespace fileFormats
00057 {
00058 
00059 /*---------------------------------------------------------------------------*\
00060                       Class OFFsurfaceFormat Declaration
00061 \*---------------------------------------------------------------------------*/
00062 
00063 template<class Face>
00064 class OFFsurfaceFormat
00065 :
00066     public MeshedSurface<Face>
00067 {
00068     // Private Member Functions
00069 
00070         //- Disallow default bitwise copy construct
00071         OFFsurfaceFormat(const OFFsurfaceFormat&);
00072 
00073         //- Disallow default bitwise assignment
00074         void operator=(const OFFsurfaceFormat&);
00075 
00076 
00077 public:
00078 
00079     // Constructors
00080 
00081         //- Construct from file name
00082         OFFsurfaceFormat(const fileName&);
00083 
00084 
00085     // Selectors
00086 
00087         //- Read file and return surface
00088         static autoPtr<MeshedSurface<Face> > New(const fileName& name)
00089         {
00090             return autoPtr<MeshedSurface<Face> >
00091             (
00092                 new OFFsurfaceFormat(name)
00093             );
00094         }
00095 
00096 
00097     //- Destructor
00098     virtual ~OFFsurfaceFormat()
00099     {}
00100 
00101 
00102     // Member Functions
00103 
00104         //- Write surface mesh components by proxy
00105         static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
00106 
00107         //- Read from file
00108         virtual bool read(const fileName&);
00109 
00110         //- Write object
00111         virtual void write(const fileName& name) const
00112         {
00113             write(name, MeshedSurfaceProxy<Face>(*this));
00114         }
00115 };
00116 
00117 
00118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00119 
00120 } // End namespace fileFormats
00121 } // End namespace Foam
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 
00126 #ifdef NoRepository
00127 #   include "OFFsurfaceFormat.C"
00128 #endif
00129 
00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00131 
00132 #endif
00133 
00134 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines