OFFsurfaceFormat.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2017 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fileFormats::OFFsurfaceFormat
29 
30 Description
31  Read/write Geomview OFF polyList format.
32 
33 See also
34  The <a href="http://www.geoview.org">Geoview</a>
35  file format information:
36  http://www.geomview.org/docs/html/OFF.html#OFF
37 
38 Note
39  When reading, the optional \a colorspec is ignored.
40  When writing, it is set to the zone number (integer).
41 
42 SourceFiles
43  OFFsurfaceFormat.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef OFFsurfaceFormat_H
48 #define OFFsurfaceFormat_H
49 
50 #include "MeshedSurface.H"
51 #include "MeshedSurfaceProxy.H"
52 #include "UnsortedMeshedSurface.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace fileFormats
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class fileFormats::OFFsurfaceFormat Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Face>
66 class OFFsurfaceFormat
67 :
68  public MeshedSurface<Face>
69 {
70 public:
71 
72  // Constructors
73 
74  //- Construct from file name
75  OFFsurfaceFormat(const fileName& filename);
76 
77 
78  //- Destructor
79  virtual ~OFFsurfaceFormat() = default;
80 
81 
82  // Static Member Functions
83 
84  //- Write surface mesh components by proxy
85  static void write
86  (
87  const fileName& filename,
88  const MeshedSurfaceProxy<Face>& surf,
89  const dictionary& options = dictionary::null
90  );
91 
92 
93  // Member Functions
94 
95  //- Read from file
96  virtual bool read(const fileName& filename);
97 
98  //- Write surface mesh to file
99  virtual void write
100  (
101  const fileName& name,
102  const dictionary& options = dictionary::null
103  ) const
104  {
105  write(name, MeshedSurfaceProxy<Face>(*this), options);
106  }
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace fileFormats
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 
118 #ifdef NoRepository
119  #include "OFFsurfaceFormat.C"
120 #endif
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::fileFormats::OFFsurfaceFormat
Read/write Geomview OFF polyList format.
Definition: OFFsurfaceFormat.H:65
Foam::fileFormats::OFFsurfaceFormat::~OFFsurfaceFormat
virtual ~OFFsurfaceFormat()=default
Destructor.
MeshedSurfaceProxy.H
Foam::fileFormats::OFFsurfaceFormat::read
virtual bool read(const fileName &filename)
Read from file.
Definition: OFFsurfaceFormat.C:51
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
OFFsurfaceFormat.C
Foam::MeshedSurfaceProxy
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Definition: MeshedSurface.H:78
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
Foam::fileFormats::OFFsurfaceFormat::OFFsurfaceFormat
OFFsurfaceFormat(const fileName &filename)
Construct from file name.
Definition: OFFsurfaceFormat.C:39
UnsortedMeshedSurface.H
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::OFFsurfaceFormat::write
static void write(const fileName &filename, const MeshedSurfaceProxy< Face > &surf, const dictionary &options=dictionary::null)
Write surface mesh components by proxy.
Definition: OFFsurfaceFormat.C:149
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
MeshedSurface.H