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