OGS
MeshIO.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <string>
7#include <vector>
8
9#include "BaseLib/IO/Writer.h"
10#include "MeshLib/MeshEnums.h"
11
12namespace MeshLib
13{
14class Mesh;
15class Node;
16class Element;
17template <typename T>
18class PropertyVector;
19enum class MeshElemType;
20namespace IO
21{
22namespace Legacy
23{
26{
27public:
30
31 ~MeshIO() override = default;
32
34 MeshLib::Mesh* loadMeshFromFile(const std::string& file_name);
35
37 void setMesh(const MeshLib::Mesh* mesh);
38
39protected:
41 bool write() override;
42
43private:
44 const MeshLib::Mesh* _mesh{nullptr};
45
46}; /* class */
47
48} // end namespace Legacy
49} // end namespace IO
50} // end namespace MeshLib
Base class which enables writing an object to string, stringstream or file.
Definition Writer.h:21
bool write() override
Write mesh to stream.
Definition MeshIO.cpp:389
MeshLib::Mesh * loadMeshFromFile(const std::string &file_name)
Read mesh from file.
Definition MeshIO.cpp:267
const MeshLib::Mesh * _mesh
Definition MeshIO.h:44
~MeshIO() override=default
void setMesh(const MeshLib::Mesh *mesh)
Set mesh for writing.
Definition MeshIO.cpp:427
MeshElemType
Types of mesh elements supported by OpenGeoSys. Values are from VTKCellType enum.
Definition MeshEnums.h:37