VTKedgeFormat.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::VTKedgeFormat
28 
29 Description
30  Provide a means of writing VTK legacy format.
31 
32 SourceFiles
33  VTKedgeFormat.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef VTKedgeFormat_H
38 #define VTKedgeFormat_H
39 
40 #include "edgeMesh.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace fileFormats
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class VTKedgeFormat Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class VTKedgeFormat
54 :
55  public edgeMesh
56 {
57  // Private Member Functions
58 
59  //- No copy construct
60  VTKedgeFormat(const VTKedgeFormat&) = delete;
61 
62  //- No copy assignment
63  void operator=(const VTKedgeFormat&) = delete;
64 
65 
66 protected:
67 
68  // Protected Member Functions
69 
70  //- Write header information with points
71  static void writeHeader
72  (
73  Ostream&,
74  const pointField&
75  );
76 
77  //- Write edges
78  static void writeEdges(Ostream&, const UList<edge>&);
79 
80 
81 public:
82 
83 
84  // Constructors
85 
86  //- Construct from file name
87  VTKedgeFormat(const fileName&);
88 
89 
90  // Selectors
91 
92  //- Read file and return surface
93  static autoPtr<edgeMesh> New(const fileName& name)
94  {
96  }
97 
98 
99  //- Destructor
100  virtual ~VTKedgeFormat() = default;
101 
102 
103  // Member Functions
104 
105  //- Write surface mesh components by proxy
106  static void write(const fileName&, const edgeMesh&);
107 
108  //- Read from file
109  virtual bool read(const fileName&);
110 
111  //- Write object file
112  virtual void write(const fileName& name) const
113  {
114  write(name, *this);
115  }
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace fileFormats
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileFormats::VTKedgeFormat::writeEdges
static void writeEdges(Ostream &, const UList< edge > &)
Write edges.
Definition: VTKedgeFormat.C:62
Foam::fileFormats::VTKedgeFormat
Provide a means of writing VTK legacy format.
Definition: VTKedgeFormat.H:52
Foam::Field< vector >
edgeMesh.H
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::fileFormats::VTKedgeFormat::~VTKedgeFormat
virtual ~VTKedgeFormat()=default
Destructor.
Foam::fileFormats::VTKedgeFormat::New
static autoPtr< edgeMesh > New(const fileName &name)
Read file and return surface.
Definition: VTKedgeFormat.H:92
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fileFormats::VTKedgeFormat::write
static void write(const fileName &, const edgeMesh &)
Write surface mesh components by proxy.
Definition: VTKedgeFormat.C:146
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fileFormats::VTKedgeFormat::writeHeader
static void writeHeader(Ostream &, const pointField &)
Write header information with points.
Definition: VTKedgeFormat.C:38
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:52
Foam::fileFormats::VTKedgeFormat::read
virtual bool read(const fileName &)
Read from file.
Definition: VTKedgeFormat.C:90
Foam::fileFormats::VTKedgeFormat::write
virtual void write(const fileName &name) const
Write object file.
Definition: VTKedgeFormat.H:111