OGS
|
Interface for handling mesh files from OGS-5 and below. (*.msh files)
#include <MeshIO.h>
Public Member Functions | |
MeshIO () | |
Constructor. | |
~MeshIO () override=default | |
MeshLib::Mesh * | loadMeshFromFile (const std::string &file_name) |
Read mesh from file. | |
void | setMesh (const MeshLib::Mesh *mesh) |
Set mesh for writing. | |
Public Member Functions inherited from BaseLib::IO::Writer | |
Writer () | |
virtual | ~Writer ()=default |
std::string | writeToString () |
Writes the object to a string. | |
Protected Member Functions | |
bool | write () override |
Write mesh to stream. | |
Private Attributes | |
const MeshLib::Mesh * | _mesh {nullptr} |
Additional Inherited Members | |
Protected Attributes inherited from BaseLib::IO::Writer | |
std::ostringstream | out |
The stream to write to. | |
|
default |
Constructor.
|
overridedefault |
MeshLib::Mesh * MeshLib::IO::Legacy::MeshIO::loadMeshFromFile | ( | const std::string & | file_name | ) |
Read mesh from file.
Definition at line 278 of file MeshIO.cpp.
References MeshLib::Cell, MeshLib::Properties::createNewPropertyVector(), ERR(), BaseLib::extractBaseNameWithoutExtension(), MeshLib::Mesh::getProperties(), INFO(), BaseLib::trim(), and WARN().
Referenced by OGSFileConverter::convertMSH2VTU(), and anonymous_namespace{readMeshFromFile.cpp}::readMeshFromFileSerial().
void MeshLib::IO::Legacy::MeshIO::setMesh | ( | const MeshLib::Mesh * | mesh | ) |
Set mesh for writing.
Definition at line 439 of file MeshIO.cpp.
References _mesh.
Referenced by SaveMeshDialog::accept(), OGSFileConverter::convertVTU2MSH(), main(), and MeshLib::IO::writeMeshToFile().
|
overrideprotectedvirtual |
Write mesh to stream.
Implements BaseLib::IO::Writer.
Definition at line 401 of file MeshIO.cpp.
References _mesh, MeshLib::Properties::existsPropertyVector(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNode(), MeshLib::Mesh::getNumberOfNodes(), MeshLib::Mesh::getProperties(), MeshLib::Properties::getPropertyVector(), BaseLib::IO::Writer::out, and WARN().
|
private |