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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fileFormats::OBJedgeFormat
28 
29 Description
30  Provide a means of reading/writing Alias/Wavefront OBJ format.
31 
32  Does not handle negative vertex indices.
33 
34 SourceFiles
35  OBJedgeFormat.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef OBJedgeFormat_H
40 #define OBJedgeFormat_H
41 
42 #include "edgeMesh.H"
43 #include "Fstream.H"
44 #include "Ostream.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 namespace fileFormats
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class OBJedgeFormat Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class OBJedgeFormat
58 :
59  public edgeMesh
60 {
61  // Private Member Functions
62 
63  //- No copy construct
64  OBJedgeFormat(const OBJedgeFormat&) = delete;
65 
66  //- No copy assignment
67  void operator=(const OBJedgeFormat&) = delete;
68 
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct from file name
75  OBJedgeFormat(const fileName&);
76 
77 
78  // Selectors
79 
80  //- Read file and return surface
81  static autoPtr<edgeMesh> New(const fileName& name)
82  {
84  }
85 
86 
87  //- Destructor
88  virtual ~OBJedgeFormat() = default;
89 
90 
91  // Member Functions
92 
93  //- Write surface mesh components by proxy
94  static void write(const fileName&, const edgeMesh&);
95 
96  //- Read from file
97  virtual bool read(const fileName&);
98 
99  //- Write object file
100  virtual void write(const fileName& name) const
101  {
102  write(name, *this);
103  }
104 };
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace fileFormats
110 } // End namespace Foam
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 #endif
115 
116 // ************************************************************************* //
Foam::fileFormats::OBJedgeFormat::read
virtual bool read(const fileName &)
Read from file.
Definition: OBJedgeFormat.C:96
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileFormats::OBJedgeFormat::~OBJedgeFormat
virtual ~OBJedgeFormat()=default
Destructor.
Foam::fileFormats::OBJedgeFormat::write
virtual void write(const fileName &name) const
Write object file.
Definition: OBJedgeFormat.H:99
edgeMesh.H
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::fileFormats::OBJedgeFormat
Provide a means of reading/writing Alias/Wavefront OBJ format.
Definition: OBJedgeFormat.H:56
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::OBJedgeFormat::write
static void write(const fileName &, const edgeMesh &)
Write surface mesh components by proxy.
Definition: OBJedgeFormat.C:226
Foam::fileFormats::OBJedgeFormat::New
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
Definition: OBJedgeFormat.H:80
Ostream.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Fstream.H
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:52