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-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fileFormats::OFFsurfaceFormat
29
30Description
31 Read/write Geomview OFF polyList format.
32
33See 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
38Note
39 When reading, the optional \a colorspec is ignored.
40 When writing, it is set to the zone number (integer).
41
42 Output stream options:
43 - ASCII only
44 - compression on/off
45
46 Output dictionary options: ignored
47
48SourceFiles
49 OFFsurfaceFormat.C
50
51\*---------------------------------------------------------------------------*/
52
53#ifndef OFFsurfaceFormat_H
54#define OFFsurfaceFormat_H
55
56#include "MeshedSurface.H"
57#include "MeshedSurfaceProxy.H"
59
60// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61
62namespace Foam
63{
64namespace fileFormats
65{
66
67/*---------------------------------------------------------------------------*\
68 Class fileFormats::OFFsurfaceFormat Declaration
69\*---------------------------------------------------------------------------*/
70
71template<class Face>
73:
74 public MeshedSurface<Face>
75{
76public:
77
78 // Constructors
79
80 //- Construct from file name
81 OFFsurfaceFormat(const fileName& filename);
82
83
84 //- Destructor
85 virtual ~OFFsurfaceFormat() = default;
86
87
88 // Static Functions
89
90 //- Write surface mesh components by proxy
91 static void write
92 (
93 const fileName& filename,
94 const MeshedSurfaceProxy<Face>& surf,
95 IOstreamOption streamOpt = IOstreamOption(),
96 const dictionary& /*unused*/ = dictionary::null
97 );
98
99
100 // Member Functions
101
102 //- Read from file
103 virtual bool read(const fileName& filename);
104
105 //- Write surface mesh to file
106 virtual void write
107 (
108 const fileName& name,
109 IOstreamOption streamOpt = IOstreamOption(),
110 const dictionary& options = dictionary::null
111 ) const
112 {
113 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
114 }
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// ************************************************************************* //
The IOstreamOption is a simple container for options an IOstream can normally have.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:99
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Read/write Geomview OFF polyList format.
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write surface mesh to file.
virtual bool read(const fileName &filename)
Read from file.
virtual ~OFFsurfaceFormat()=default
Destructor.
A class for handling file names.
Definition: fileName.H:76
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()