Instructions if the OK-Button has been pressed.
61{
62 QString const& file_name(this->fileNameEdit->text());
63 if (file_name.isEmpty())
64 {
66 return;
67 }
68
69 QFileInfo fi(file_name);
70 if (fi.suffix().toLower() == "vtu")
71 {
72 int dataMode = this->dataModeBox->currentIndex();
73 bool compress(this->compressionCheckBox->isChecked());
74 MeshLib::IO::VtuInterface vtkIO(&
_mesh, dataMode, compress);
75 vtkIO.writeToFile(file_name.toStdString());
76 }
77 if (fi.suffix().toLower() == "msh")
78 {
79 MeshLib::IO::Legacy::MeshIO meshIO;
82 file_name.toStdString());
83 }
85
86 this->done(QDialog::Accepted);
87}
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)