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 // ************************************************************************* //
virtual ~OBJedgeFormat()=default
Destructor.
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
static void write(const fileName &filename, const edgeMesh &mesh, IOstreamOption=IOstreamOption(), const dictionary &options=dictionary::null)
Write edge mesh to file.
A simple container for options an IOstream can normally have.
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
Definition: OBJedgeFormat.H:85
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:474
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:47
Provide a means of reading/writing Alias/Wavefront OBJ format.
Definition: OBJedgeFormat.H:53
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual bool read(const fileName &name)
Read from file.
Definition: OBJedgeFormat.C:89
Namespace for OpenFOAM.