OBJsurfaceFormat.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::OBJsurfaceFormat
29
30Description
31 Read/write Alias/Wavefront OBJ format.
32
33 Does not handle negative face indices.
34
35 Output stream options:
36 - ASCII only
37 - compression on/off
38
39 Output dictionary options: ignored
40
41SourceFiles
42 OBJsurfaceFormat.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef OBJsurfaceFormat_H
47#define OBJsurfaceFormat_H
48
49#include "MeshedSurface.H"
50#include "MeshedSurfaceProxy.H"
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57namespace fileFormats
58{
59
60/*---------------------------------------------------------------------------*\
61 Class fileFormats::OBJsurfaceFormat Declaration
62\*---------------------------------------------------------------------------*/
63
64template<class Face>
66:
67 public MeshedSurface<Face>
68{
69public:
70
71 // Constructors
72
73 //- Construct from file name
74 OBJsurfaceFormat(const fileName& filename);
75
76
77 //- Destructor
78 virtual ~OBJsurfaceFormat() = default;
79
80
81 // Static Functions
82
83 //- Write surface mesh components by proxy
84 static void write
85 (
86 const fileName& filename,
87 const MeshedSurfaceProxy<Face>& surf,
88 IOstreamOption streamOpt = IOstreamOption(),
89 const dictionary& /*unused*/ = 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 IOstreamOption streamOpt = IOstreamOption(),
103 const dictionary& options = dictionary::null
104 ) const
105 {
106 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
107 }
108};
109
110
111// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112
113} // End namespace fileFormats
114} // End namespace Foam
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118#ifdef NoRepository
119 #include "OBJsurfaceFormat.C"
120#endif
121
122// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
124#endif
125
126// ************************************************************************* //
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 Alias/Wavefront OBJ format.
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write surface mesh to file.
virtual ~OBJsurfaceFormat()=default
Destructor.
virtual bool read(const fileName &filename)
Read from file.
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()