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

AC3DsurfaceFormat.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::AC3DsurfaceFormat
00026 
00027 Description
00028     Provide a means of reading/writing AC3D format.
00029 
00030     http://www.inivis.com/ac3d/man/ac3dfileformat.html
00031 
00032 Note
00033     On input, the faces are already organized as zones.
00034     The output is always sorted by zones.
00035     In the absence of zones, a single zone will be assigned.
00036 
00037 SourceFiles
00038     AC3DsurfaceFormat.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef AC3DsurfaceFormat_H
00043 #define AC3DsurfaceFormat_H
00044 
00045 #include <surfMesh/MeshedSurface.H>
00046 #include <surfMesh/MeshedSurfaceProxy.H>
00047 #include <surfMesh/UnsortedMeshedSurface.H>
00048 #include "AC3DsurfaceFormatCore.H"
00049 
00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00051 
00052 namespace Foam
00053 {
00054 namespace fileFormats
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058                       Class AC3DsurfaceFormat Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 template<class Face>
00062 class AC3DsurfaceFormat
00063 :
00064     public MeshedSurface<Face>,
00065     public AC3DsurfaceFormatCore
00066 {
00067     // Private Member Functions
00068 
00069         //- Disallow default bitwise copy construct
00070         AC3DsurfaceFormat(const AC3DsurfaceFormat<Face>&);
00071 
00072         //- Disallow default bitwise assignment
00073         void operator=(const AC3DsurfaceFormat<Face>&);
00074 
00075 
00076 public:
00077 
00078     // Constructors
00079 
00080         //- Construct from file name
00081         AC3DsurfaceFormat(const fileName&);
00082 
00083 
00084     // Selectors
00085 
00086         //- Read file and return surface
00087         static autoPtr<MeshedSurface<Face> > New(const fileName& name)
00088         {
00089             return autoPtr<MeshedSurface<Face> >
00090             (
00091                 new AC3DsurfaceFormat<Face>(name)
00092             );
00093         }
00094 
00095 
00096     // Destructor
00097 
00098         virtual ~AC3DsurfaceFormat()
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         //- Write UnsortedMeshedSurface, the output is always sorted by zones.
00108         static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
00109 
00110         //- Read from file
00111         virtual bool read(const fileName&);
00112 
00113         //- Write object
00114         virtual void write(const fileName& name) const
00115         {
00116             write(name, MeshedSurfaceProxy<Face>(*this));
00117         }
00118 };
00119 
00120 
00121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00122 
00123 } // End namespace fileFormats
00124 } // End namespace Foam
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 #ifdef NoRepository
00129 #   include "AC3DsurfaceFormat.C"
00130 #endif
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 #endif
00135 
00136 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines