OFFsurfaceFormat.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fileFormats::OFFsurfaceFormat
26 
27 Description
28  Provide a means of reading/writing Geomview OFF polyList format.
29 
30 
31 See also
32  The <a href="http://www.geoview.org">Geoview</a>
33  file format information:
34  http://www.geomview.org/docs/html/OFF.html#OFF
35 
36 Note
37  When reading, the optional \a colorspec is ignored.
38  When writing, it is set to the zone number (integer).
39 
40 SourceFiles
41  OFFsurfaceFormat.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef OFFsurfaceFormat_H
46 #define OFFsurfaceFormat_H
47 
48 #include "MeshedSurface.H"
49 #include "MeshedSurfaceProxy.H"
50 #include "UnsortedMeshedSurface.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace fileFormats
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class OFFsurfaceFormat Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class Face>
64 class OFFsurfaceFormat
65 :
66  public MeshedSurface<Face>
67 {
68 public:
69 
70  // Constructors
71 
72  //- Construct from file name
73  OFFsurfaceFormat(const fileName&);
74 
75  //- Disallow default bitwise copy construction
76  OFFsurfaceFormat(const OFFsurfaceFormat&) = delete;
77 
78 
79  // Selectors
80 
81  //- Read file and return surface
83  {
85  (
86  new OFFsurfaceFormat(name)
87  );
88  }
89 
90 
91  //- Destructor
92  virtual ~OFFsurfaceFormat()
93  {}
94 
95 
96  // Member Functions
97 
98  //- Write surface mesh components by proxy
99  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
100 
101  //- Read from file
102  virtual bool read(const fileName&);
103 
104  //- Write object
105  virtual void write(const fileName& name) const
106  {
107  write(name, MeshedSurfaceProxy<Face>(*this));
108  }
109 
110 
111  // Member Operators
112 
113  //- Disallow default bitwise assignment
114  void operator=(const OFFsurfaceFormat&) = delete;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace fileFormats
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 
126 #ifdef NoRepository
127  #include "OFFsurfaceFormat.C"
128 #endif
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:79
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:72
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
virtual bool read(const fileName &)
Read from file.
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:73
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
virtual ~OFFsurfaceFormat()
Destructor.
OFFsurfaceFormat(const fileName &)
Construct from file name.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
void operator=(const OFFsurfaceFormat &)=delete
Disallow default bitwise assignment.
Provide a means of reading/writing Geomview OFF polyList format.
Namespace for OpenFOAM.