Instructions if the OK-Button has been pressed.
72{
73 QString const& file_name(this->fileNameEdit->text());
74 if (file_name.isEmpty())
75 {
77 return;
78 }
79
80 QFileInfo fi(file_name);
81 if (fi.suffix().toLower() == "vtu")
82 {
83 int dataMode = this->dataModeBox->currentIndex();
84 bool compress(this->compressionCheckBox->isChecked());
85 MeshLib::IO::VtuInterface vtkIO(&
_mesh, dataMode, compress);
86 vtkIO.writeToFile(file_name.toStdString());
87 }
88 if (fi.suffix().toLower() == "msh")
89 {
90 MeshLib::IO::Legacy::MeshIO meshIO;
93 file_name.toStdString());
94 }
96
97 this->done(QDialog::Accepted);
98}
std::string writeToString()
Writes the object to a string.
static void setDir(const QString &path)
Sets the directory last used for saving a file.
void setMesh(const MeshLib::Mesh *mesh)
Set mesh for writing.
static void box(const QString &e)
int writeStringToFile(std::string_view content, std::filesystem::path const &file_path)