From: vsr Date: Tue, 30 Oct 2018 10:54:27 +0000 (+0300) Subject: 0023191: [CEA 1607] REGRESSION : the file hdf does not save the data PARAVIS X-Git-Tag: V9_2_0a2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=233a3ed7b3bfb65744c59e04b15124e016fe32f6;p=modules%2Fparavis.git 0023191: [CEA 1607] REGRESSION : the file hdf does not save the data PARAVIS - Show warning message when saving a study if a) multi-file format is saved or b) multi-index element is saved --- diff --git a/src/PVGUI/PVGUI_DataModel.cxx b/src/PVGUI/PVGUI_DataModel.cxx index 9e321776..5a644c89 100644 --- a/src/PVGUI/PVGUI_DataModel.cxx +++ b/src/PVGUI/PVGUI_DataModel.cxx @@ -45,6 +45,7 @@ // ParaView include #include #include +#include const QString PVGUI_DataModel::RESTORE_FLAG_FILE = "do_restore_paravis_references.par"; @@ -53,9 +54,29 @@ const QString PVGUI_DataModel::RESTORE_FLAG_FILE = "do_restore_paravis_reference */ namespace { + QStringList multiFormats() + { + static QStringList formats; + if ( formats.isEmpty() ) + formats << "vtm" << "lata" << "pvd"; + return formats; + } + void warning( const QString& message ) + { + vtkOutputWindow* vtkWindow = vtkOutputWindow::GetInstance(); + if ( vtkWindow ) + { + vtkWindow->DisplayWarningText( qPrintable( message ) ); + } + } + void processElements(QDomNode& thePropertyNode, QStringList& theFileNames, const QString& theNewPath, bool theRestore) { + QDomElement aProperty = thePropertyNode.toElement(); + int aNbElements = aProperty.attribute("number_of_elements").toInt(); + if ( aNbElements > 1 ) + warning( QString("You save data file with number of entities > 1 (%1); some data may be lost!").arg(aNbElements) ); QDomNode aElementNode = thePropertyNode.firstChild(); while (aElementNode.isElement()) { QDomElement aElement = aElementNode.toElement(); @@ -67,6 +88,9 @@ namespace { if (theNewPath.isEmpty()) { QFileInfo aFInfo(aValue); if (aFInfo.exists()) { + QString ext = aFInfo.suffix(); + if ( multiFormats().contains(aFInfo.suffix()) ) + warning( QString("You save data in multiple file format (%1); some data may be not saved!").arg(ext) ); theFileNames<