initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / surfMesh / surfaceFormats / off / OFFsurfaceFormat.H
blobc627ce38a88c6e2a8e75946c727cb2e699ea8726
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::fileFormats::OFFsurfaceFormat
28 Description
29     Provide a means of reading/writing Geomview OFF polyList format.
32 See Also
33     The <a href="http://www.geoview.org">Geoview</a>
34     file format information:
35     http://www.geomview.org/docs/html/OFF.html#OFF
37 Note
38     When reading, the optional @a colorspec is ignored.
39     When writing, it is set to the zone number (integer).
41 SourceFiles
42     OFFsurfaceFormat.C
44 \*---------------------------------------------------------------------------*/
46 #ifndef OFFsurfaceFormat_H
47 #define OFFsurfaceFormat_H
49 #include "MeshedSurface.H"
50 #include "MeshedSurfaceProxy.H"
51 #include "UnsortedMeshedSurface.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 namespace Foam
57 namespace fileFormats
60 /*---------------------------------------------------------------------------*\
61                       Class OFFsurfaceFormat Declaration
62 \*---------------------------------------------------------------------------*/
64 template<class Face>
65 class OFFsurfaceFormat
67     public MeshedSurface<Face>
69     // Private Member Functions
71         //- Disallow default bitwise copy construct
72         OFFsurfaceFormat(const OFFsurfaceFormat&);
74         //- Disallow default bitwise assignment
75         void operator=(const OFFsurfaceFormat&);
78 public:
80     // Constructors
82         //- Construct from file name
83         OFFsurfaceFormat(const fileName&);
86     // Selectors
88         //- Read file and return surface
89         static autoPtr<MeshedSurface<Face> > New(const fileName& name)
90         {
91             return autoPtr<MeshedSurface<Face> >
92             (
93                 new OFFsurfaceFormat(name)
94             );
95         }
98     //- Destructor
99     virtual ~OFFsurfaceFormat()
100     {}
103     // Member Functions
105         //- Write surface mesh components by proxy
106         static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
108         //- Read from file
109         virtual bool read(const fileName&);
111         //- Write object
112         virtual void write(const fileName& name) const
113         {
114             write(name, MeshedSurfaceProxy<Face>(*this));
115         }
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 } // End namespace fileFormats
122 } // End namespace Foam
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 #ifdef NoRepository
128 #   include "OFFsurfaceFormat.C"
129 #endif
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 #endif
135 // ************************************************************************* //