OBJedgeFormat.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-2017 OpenFOAM Foundation
9  Copyright (C) 2021 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::OBJedgeFormat
29 
30 Description
31  Provide a means of reading/writing Alias/Wavefront OBJ format.
32 
33  Does not handle negative vertex indices.
34 
35 SourceFiles
36  OBJedgeFormat.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef OBJedgeFormat_H
41 #define OBJedgeFormat_H
42 
43 #include "edgeMesh.H"
44 #include "Fstream.H"
45 #include "Ostream.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace fileFormats
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class OBJedgeFormat Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class OBJedgeFormat
59 :
60  public edgeMesh
61 {
62  // Private Member Functions
63 
64  //- No copy construct
65  OBJedgeFormat(const OBJedgeFormat&) = delete;
66 
67  //- No copy assignment
68  void operator=(const OBJedgeFormat&) = delete;
69 
70 
71 public:
72 
73  // Constructors
74 
75  //- Construct from file name
76  OBJedgeFormat(const fileName&);
77 
78 
79  // Selectors
80 
81  //- Read file and return surface
82  static autoPtr<edgeMesh> New(const fileName& name)
83  {
85  }
86 
87 
88  //- Destructor
89  virtual ~OBJedgeFormat() = default;
90 
91 
92  // Member Functions
93 
94  //- Write edge mesh to file
95  static void write
96  (
97  const fileName& filename,
98  const edgeMesh& mesh,
99  IOstreamOption /*ignored*/ = IOstreamOption(),
100  const dictionary& options = dictionary::null
101  );
102 
103 
104  // Member Functions
105 
106  //- Read from file
107  virtual bool read(const fileName& name);
108 
109  //- Write to file
110  virtual void write
111  (
112  const fileName& name,
113  IOstreamOption streamOpt = IOstreamOption(),
114  const dictionary& options = dictionary::null
115  ) const
116  {
117  write(name, *this, streamOpt, options);
118  }
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace fileFormats
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
Foam::fileFormats::OBJedgeFormat::read
virtual bool read(const fileName &name)
Definition: OBJedgeFormat.C:89
Foam::fileName
A class for handling file names.
Definition: fileName.H:71
Foam::fileFormats::OBJedgeFormat::~OBJedgeFormat
virtual ~OBJedgeFormat()=default
Foam::dictionary::null
static const dictionary null
Definition: dictionary.H:388
Foam::fileFormats::OBJedgeFormat::write
static void write(const fileName &filename, const edgeMesh &mesh, IOstreamOption=IOstreamOption(), const dictionary &options=dictionary::null)
Definition: OBJedgeFormat.C:219
edgeMesh.H
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:59
Foam::fileFormats::OBJedgeFormat
Provide a means of reading/writing Alias/Wavefront OBJ format.
Definition: OBJedgeFormat.H:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Definition: atmBoundaryLayer.C:26
Foam::fileFormats::OBJedgeFormat::New
static autoPtr< edgeMesh > New(const fileName &name)
Definition: OBJedgeFormat.H:77
Ostream.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:49
Fstream.H
Foam::name
word name(const expressions::valueTypeCode typeCode)
Definition: exprTraits.C:52
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:47