1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
26 Foam::fileFormats::OBJsurfaceFormat
29 Provide a means of reading/writing Alias/Wavefront OBJ format.
31 Does not handle negative face indices.
36 \*---------------------------------------------------------------------------*/
38 #ifndef OBJsurfaceFormat_H
39 #define OBJsurfaceFormat_H
41 #include "MeshedSurface.H"
42 #include "MeshedSurfaceProxy.H"
43 #include "UnsortedMeshedSurface.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class OBJsurfaceFormat Declaration
54 \*---------------------------------------------------------------------------*/
57 class OBJsurfaceFormat
59 public MeshedSurface<Face>
61 // Private Member Functions
63 //- Disallow default bitwise copy construct
64 OBJsurfaceFormat(const OBJsurfaceFormat<Face>&);
66 //- Disallow default bitwise assignment
67 void operator=(const OBJsurfaceFormat<Face>&);
74 //- Construct from file name
75 OBJsurfaceFormat(const fileName&);
80 //- Read file and return surface
81 static autoPtr<MeshedSurface<Face> > New(const fileName& name)
83 return autoPtr<MeshedSurface<Face> >
85 new OBJsurfaceFormat<Face>(name)
92 virtual ~OBJsurfaceFormat()
98 //- Write surface mesh components by proxy
99 static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
102 virtual bool read(const fileName&);
104 //- Write object file
105 virtual void write(const fileName& name) const
107 write(name, MeshedSurfaceProxy<Face>(*this));
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 } // End namespace fileFormats
115 } // End namespace Foam
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 # include "OBJsurfaceFormat.C"
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 // ************************************************************************* //