From 063116fae29b1028d31042b8bb2ed15f1f7de41e Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Oct 2021 14:48:04 +0300 Subject: [PATCH] bos #26432 [CEA 26431] import/export SAUV removal --- doc/salome/gui/SMESH/input/about_meshes.rst | 2 +- .../input/importing_exporting_meshes.rst | 3 +- doc/salome/gui/SMESH/input/modules.rst | 2 - idl/SMESH_Gen.idl | 13 +- idl/SMESH_Mesh.idl | 9 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 15 -- src/DriverMED/DriverMED_W_SMESHDS_Mesh.h | 1 - src/SMESH/SMESH_Mesh.cxx | 67 +------- src/SMESH/SMESH_Mesh.hxx | 9 +- src/SMESHGUI/SMESHGUI.cxx | 82 ++------- src/SMESHGUI/SMESHGUI_Operations.h | 4 - src/SMESHGUI/SMESH_msg_en.ts | 40 ----- src/SMESHGUI/SMESH_msg_fr.ts | 40 ----- src/SMESHGUI/SMESH_msg_ja.ts | 40 ----- src/SMESH_I/SMESH_2smeshpy.cxx | 3 +- src/SMESH_I/SMESH_Gen_i.cxx | 162 ++++++------------ src/SMESH_I/SMESH_Gen_i.hxx | 9 - src/SMESH_I/SMESH_Mesh_i.cxx | 21 --- src/SMESH_I/SMESH_Mesh_i.hxx | 2 - src/SMESH_SWIG/smeshBuilder.py | 26 --- 20 files changed, 74 insertions(+), 476 deletions(-) diff --git a/doc/salome/gui/SMESH/input/about_meshes.rst b/doc/salome/gui/SMESH/input/about_meshes.rst index abb80677f..270fbe5e1 100644 --- a/doc/salome/gui/SMESH/input/about_meshes.rst +++ b/doc/salome/gui/SMESH/input/about_meshes.rst @@ -23,7 +23,7 @@ Mesh module provides several ways to create the mesh: * Bottom-up way, using :ref:`mesh modification ` operations, especially :ref:`extrusion ` and :ref:`revolution `. To create an empty mesh not based on geometry, use the same dialog as to :ref:`construct the mesh on geometry ` but specify neither the geometry nor meshing algorithms. -* The mesh can be :ref:`imported ` from (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and SAUVE formats. +* The mesh can be :ref:`imported ` from (and exported to) the file in MED, UNV, STL, CGNS, DAT and GMF formats. * The 3D mesh can be generated from the 2D mesh not based on geometry, which was either :ref:`imported ` or created in other way. To setup the meshing parameters of a mesh not based on geometry, just invoke :ref:`Edit mesh / sub-mesh ` command on your 2D mesh. diff --git a/doc/salome/gui/SMESH/input/importing_exporting_meshes.rst b/doc/salome/gui/SMESH/input/importing_exporting_meshes.rst index b4ab4d4bd..fe9aa27f1 100644 --- a/doc/salome/gui/SMESH/input/importing_exporting_meshes.rst +++ b/doc/salome/gui/SMESH/input/importing_exporting_meshes.rst @@ -8,7 +8,6 @@ Importing and exporting meshes In MESH there is a functionality allowing import/export of meshes in the following formats: * **MED**, -* **SAUV** (format of the CASTEM code), * **UNV** (I-DEAS 10), * **STL**, * **CGNS**, @@ -45,7 +44,7 @@ If you try to export a group, the warning will be shown: Only MED format supports all types of elements that can be created in the module. If you export a mesh or group that includes elements of types that are not supported by chosen format, you will be warned about that. -There are additional parameters available at export to MED and SAUV format files. +There are additional parameters available at export to MED format files. .. _export_auto_groups: diff --git a/doc/salome/gui/SMESH/input/modules.rst b/doc/salome/gui/SMESH/input/modules.rst index 88d2d2dc4..12133771b 100644 --- a/doc/salome/gui/SMESH/input/modules.rst +++ b/doc/salome/gui/SMESH/input/modules.rst @@ -25,13 +25,11 @@ Importing and exporting meshes smeshBuilder.CreateMeshesFromSTL smeshBuilder.CreateMeshesFromCGNS smeshBuilder.CreateMeshesFromGMF - smeshBuilder.CreateMeshesFromSAUV Mesh.ExportMED Mesh.ExportUNV Mesh.ExportSTL Mesh.ExportCGNS Mesh.ExportDAT - Mesh.ExportSAUV Mesh.ExportGMF diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index d5772802b..cfdca30f1 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -253,16 +253,9 @@ module SMESH /*! * Create Mesh object(s) importing data from given MED file */ - mesh_array CreateMeshesFromMED( in string theFileName, - out SMESH::DriverMED_ReadStatus theStatus ) - raises ( SALOME::SALOME_Exception ); - - /*! - * Create Mesh object(s) importing data from given MED file - */ - mesh_array CreateMeshesFromSAUV( in string theFileName, - out SMESH::DriverMED_ReadStatus theStatus ) - raises ( SALOME::SALOME_Exception ); + mesh_array CreateMeshesFromMED( in string theFileName, + out SMESH::DriverMED_ReadStatus theStatus ) + raises ( SALOME::SALOME_Exception ); /*! * Create Mesh object importing data from given STL file diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 7ee04ecee..49e8f97cb 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -714,18 +714,11 @@ module SMESH in double ZTolerance, in boolean saveNumbers) raises (SALOME::SALOME_Exception); - /*! - * Export Mesh to SAUV formatted file - * Write a temporary med file and use med2sauv - */ - void ExportSAUV( in string file, in boolean auto_groups ) - raises (SALOME::SALOME_Exception); - /*! * Return string representation of a MED file version comprising nbDigits */ string GetVersionString(in long minor, in short nbDigits); - + /*! * Return the list of med versions compatibles for write/append, * encoded in 10*major+minor (for instance, code for med 3.2.1 is 32) diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 5076ae51d..844e37238 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -166,21 +166,6 @@ void DriverMED_W_SMESHDS_Mesh::AddGroupOfBalls() myDoGroupOfBalls = true; } -//================================================================================ -/*! - * \brief Set up a flag to add all elements not belonging to any group to - * some auxiliary group. This is needed for SMESH -> SAUVE -> SMESH conversion, - * which since PAL0023285 reads only SAUVE elements belonging to any group, - * and hence can lose some elements. That auxiliary group is ignored while - * reading a MED file. - */ -//================================================================================ - -void DriverMED_W_SMESHDS_Mesh::AddAllToGroup() -{ - myDoAllInGroups = true; -} - namespace { diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h index 43e5c2745..fc8cf9b15 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h @@ -64,7 +64,6 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh void AddGroupOfVolumes(); void AddGroupOf0DElems(); void AddGroupOfBalls(); - void AddAllToGroup(); /*! functions to prepare adding one mesh */ diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 7c634c4de..f03468977 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1416,8 +1416,7 @@ void SMESH_Mesh::exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& theWriter, bool theAutoDimension, bool theAddODOnVertices, double theZTolerance, - bool theSaveNumbers, - bool theAllElemsToGroup) + bool theSaveNumbers) { Driver_Mesh::Status status = Driver_Mesh::DRS_OK; @@ -1443,8 +1442,6 @@ void SMESH_Mesh::exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& theWriter, theWriter.AddGroupOf0DElems(); theWriter.AddGroupOfBalls(); } - if ( theAllElemsToGroup ) - theWriter.AddAllToGroup(); // Pass groups to writer. Provide unique group names. //set aGroupNames; // Corrected for Mantis issue 0020028 @@ -1499,8 +1496,7 @@ SMESH_Mesh::ExportMEDCoupling(const char* theMeshName, { DriverMED_W_SMESHDS_Mesh_Mem writer; this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, - theAddODOnVertices, theZTolerance, theSaveNumbers, - /*AllElemsToGroup(for ExportSAUV())=*/false); + theAddODOnVertices, theZTolerance, theSaveNumbers); return writer.getData(); } @@ -1525,8 +1521,6 @@ SMESH_Mesh::ExportMEDCoupling(const char* theMeshName, * within a given tolerance, the coordinate is set to zero. * If \a ZTolerance is negative, the node coordinates are kept as is. * \param [in] theSaveNumbers : enable saving numbers of nodes and cells. - * \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413). - * It is used by ExportSAUV() only * \return int - mesh index in the file */ //================================================================================ @@ -1539,65 +1533,12 @@ void SMESH_Mesh::ExportMED(const char * theFile, bool theAutoDimension, bool theAddODOnVertices, double theZTolerance, - bool theSaveNumbers, - bool theAllElemsToGroup) + bool theSaveNumbers) { MESSAGE("MED_VERSION:"<< theVersion); DriverMED_W_SMESHDS_Mesh writer; writer.SetFile( theFile, theVersion ); - this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers, theAllElemsToGroup ); -} - -//================================================================================ -/*! - * \brief Export the mesh to a SAUV file - */ -//================================================================================ - -void SMESH_Mesh::ExportSAUV(const char *theFile, - const char* theMeshName, - bool theAutoGroups) -{ - std::string medfilename( theFile ); - medfilename += ".med"; - std::string cmd; -#ifdef WIN32 - cmd = "%PYTHONBIN% "; -#else - cmd = "python3 "; -#endif - cmd += "-c \""; - cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')"; - cmd += "\""; - system(cmd.c_str()); - try { - ExportMED( medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1, - /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false, - /*zTol=*/-1, /*theSaveNumbers=*/false, - /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413 - } - catch ( TooLargeForExport ) - { - throw TooLargeForExport("SAUV"); - } -#ifdef WIN32 - cmd = "%PYTHONBIN% "; -#else - cmd = "python3 "; -#endif - cmd += "-c \""; - cmd += "from medutilities import convert ; convert(r'" + medfilename + "', 'MED', 'GIBI', 1, r'" + theFile + "')"; - cmd += "\""; - system(cmd.c_str()); -#ifdef WIN32 - cmd = "%PYTHONBIN% "; -#else - cmd = "python3 "; -#endif - cmd += "-c \""; - cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')"; - cmd += "\""; - system(cmd.c_str()); + this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers ); } //================================================================================ diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 81495db9c..927aa4047 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -282,8 +282,7 @@ class SMESH_EXPORT SMESH_Mesh bool theAutoDimension = false, bool theAddODOnVertices = false, double theZTolerance = -1., - bool theSaveNumbers = true, - bool theAllElemsToGroup = false); + bool theSaveNumbers = true); void ExportDAT(const char * file, const SMESHDS_Mesh* meshPart = 0, @@ -302,9 +301,6 @@ class SMESH_EXPORT SMESH_Mesh void ExportGMF(const char * file, const SMESHDS_Mesh* mesh, bool withRequiredGroups = true ); - void ExportSAUV(const char *file, - const char* theMeshName = NULL, - bool theAutoGroups = true); double GetComputeProgress() const; @@ -395,8 +391,7 @@ private: bool theAutoDimension, bool theAddODOnVertices, double theZTolerance, - bool theSaveNumbers, - bool theAllElemsToGroup); + bool theSaveNumbers); private: void fillAncestorsMap(const TopoDS_Shape& theShape); diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index ca9c78767..531901fd1 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -239,11 +239,6 @@ namespace theCommandID == SMESHOp::OpPopupImportCGNS ) { filter.append( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" ); } - else if ( theCommandID == SMESHOp::OpImportSAUV || - theCommandID == SMESHOp::OpPopupImportSAUV ) { - filter.append( QObject::tr( "SAUV_FILES_FILTER" ) + " (*.sauv *.sauve)" ); - filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" ); - } else if ( theCommandID == SMESHOp::OpImportGMF || theCommandID == SMESHOp::OpPopupImportGMF ) { filter.append( QObject::tr( "GMF_ASCII_FILES_FILTER" ) + " (*.mesh)" ); @@ -345,18 +340,6 @@ namespace } break; } - case SMESHOp::OpImportSAUV: - case SMESHOp::OpPopupImportSAUV: - { - // SAUV format - SMESH::DriverMED_ReadStatus res; - aMeshes = theComponentMesh->CreateMeshesFromSAUV( filename.toUtf8().constData(), res ); - if ( res != SMESH::DRS_OK ) { - errors.append( QString( "%1 :\n\t%2" ).arg( filename ). - arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) ); - } - break; - } case SMESHOp::OpImportGMF: case SMESHOp::OpPopupImportGMF: { @@ -448,8 +431,6 @@ namespace theCommandID == SMESHOp::OpPopupExportSTL ); const bool isCGNS= ( theCommandID == SMESHOp::OpExportCGNS || theCommandID == SMESHOp::OpPopupExportCGNS ); - const bool isSAUV= ( theCommandID == SMESHOp::OpExportSAUV || - theCommandID == SMESHOp::OpPopupExportSAUV ); const bool isGMF = ( theCommandID == SMESHOp::OpExportGMF || theCommandID == SMESHOp::OpPopupExportGMF ); @@ -529,7 +510,7 @@ namespace SMESH::SMESH_Mesh_var aMesh = aMeshOrGroup->GetMesh(); QString aMeshName = (*aMeshIter).second; - if ( isMED || isCGNS || isSAUV ) // formats where group names must be unique + if ( isMED || isCGNS ) // formats where group names must be unique { // check for equal group names within each mesh for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) { @@ -581,18 +562,6 @@ namespace format = "CGNS"; notSupportedElemTypes.push_back( SMESH::Entity_Ball ); } - else if ( isSAUV ) - { - format = "SAUV"; - notSupportedElemTypes.push_back( SMESH::Entity_Ball ); - notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Triangle ); - notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Quadrangle ); - notSupportedElemTypes.push_back( SMESH::Entity_TriQuad_Hexa ); - notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism ); - notSupportedElemTypes.push_back( SMESH::Entity_Polygon ); - notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon ); - notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra ); - } else if ( isGMF ) { format = "GMF"; @@ -741,26 +710,19 @@ namespace } delete fd; } - else if ( isMED || isSAUV ) // Export to MED or SAUV + else if ( isMED ) // Export to MED { int defaultVersion = 0; QMap aFilterMap; - if ( isMED ) { - //filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)"; - //QString vmed (aMesh->GetVersionString(-1, 2)); - SMESH::long_array_var mvok = aMesh->GetMEDVersionsCompatibleForAppend(); - if ( mvok->length() > 0) - defaultVersion = mvok[0]; // the current version to set the default filter on it - for ( CORBA::ULong i = 0; i < mvok->length(); ++i ) - { - QString vs = (char*)( SMESH_Comment( mvok[i]/10 ) << "." << mvok[i]%10 ); - aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", mvok[i]); - } - } - else { // isSAUV - aFilterMap.insert("All files (*)", -1 ); - aFilterMap.insert("SAUV files (*.sauv)", defaultVersion ); // 0 = default filter (defaultVersion) - aFilterMap.insert("SAUV files (*.sauve)", -1 ); + //filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)"; + //QString vmed (aMesh->GetVersionString(-1, 2)); + SMESH::long_array_var mvok = aMesh->GetMEDVersionsCompatibleForAppend(); + if ( mvok->length() > 0) + defaultVersion = mvok[0]; // the current version to set the default filter on it + for ( CORBA::ULong i = 0; i < mvok->length(); ++i ) + { + QString vs = (char*)( SMESH_Comment( mvok[i]/10 ) << "." << mvok[i]%10 ); + aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", mvok[i]); } QStringList filters; QMap::const_iterator it = aFilterMap.begin(); @@ -946,15 +908,6 @@ namespace fields, geoAssFields.toLatin1().data(), zTol, saveNumbers ); } } - else if ( isSAUV ) - { - for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) - { - SMESH::SMESH_Mesh_var aMeshItem = SMESH::SMESH_Mesh::_narrow( (*aMeshIter).first ); - if( !aMeshItem->_is_nil() ) - aMeshItem->ExportSAUV( aFilename.toUtf8().data(), toCreateGroups ); - } - } else if ( isDAT ) { if ( aMeshOrGroup->_is_equivalent( aMesh )) @@ -2599,14 +2552,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpImportMED: case SMESHOp::OpImportSTL: case SMESHOp::OpImportCGNS: - case SMESHOp::OpImportSAUV: case SMESHOp::OpImportGMF: case SMESHOp::OpPopupImportDAT: case SMESHOp::OpPopupImportUNV: case SMESHOp::OpPopupImportMED: case SMESHOp::OpPopupImportSTL: case SMESHOp::OpPopupImportCGNS: - case SMESHOp::OpPopupImportSAUV: case SMESHOp::OpPopupImportGMF: { if(isStudyLocked()) break; @@ -2637,14 +2588,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case SMESHOp::OpExportUNV: case SMESHOp::OpExportSTL: case SMESHOp::OpExportCGNS: - case SMESHOp::OpExportSAUV: case SMESHOp::OpExportGMF: case SMESHOp::OpPopupExportDAT: case SMESHOp::OpPopupExportMED: case SMESHOp::OpPopupExportUNV: case SMESHOp::OpPopupExportSTL: case SMESHOp::OpPopupExportCGNS: - case SMESHOp::OpPopupExportSAUV: case SMESHOp::OpPopupExportGMF: { ::ExportMeshToFile(theCommandID); @@ -4114,7 +4063,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createSMESHAction( SMESHOp::OpImportCGNS, "IMPORT_CGNS" ); #endif - createSMESHAction( SMESHOp::OpImportSAUV, "IMPORT_SAUV" ); createSMESHAction( SMESHOp::OpImportGMF, "IMPORT_GMF" ); createSMESHAction( SMESHOp::OpPopupImportUNV, "IMPORT_UNV"); createSMESHAction( SMESHOp::OpPopupImportMED, "IMPORT_MED"); @@ -4122,7 +4070,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" ); #endif - createSMESHAction( SMESHOp::OpPopupImportSAUV, "IMPORT_SAUV" ); createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" ); createSMESHAction( SMESHOp::OpExportDAT, "DAT" ); @@ -4132,7 +4079,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createSMESHAction( SMESHOp::OpExportCGNS, "CGNS"); #endif - createSMESHAction( SMESHOp::OpExportSAUV, "SAUV"); createSMESHAction( SMESHOp::OpExportGMF, "GMF" ); createSMESHAction( SMESHOp::OpPopupExportDAT, "DAT" ); createSMESHAction( SMESHOp::OpPopupExportMED, "MED" ); @@ -4141,7 +4087,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createSMESHAction( SMESHOp::OpPopupExportCGNS, "CGNS"); #endif - createSMESHAction( SMESHOp::OpPopupExportSAUV, "SAUV"); createSMESHAction( SMESHOp::OpPopupExportGMF, "GMF" ); createSMESHAction( SMESHOp::OpFileInformation, "FILE_INFO" ); createSMESHAction( SMESHOp::OpDelete, "DELETE", "ICON_DELETE", Qt::Key_Delete ); @@ -4380,7 +4325,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createMenu( SMESHOp::OpImportCGNS, importId, -1 ); #endif - createMenu( SMESHOp::OpImportSAUV, importId, -1 ); createMenu( SMESHOp::OpImportGMF, importId, -1 ); createMenu( SMESHOp::OpExportDAT, exportId, -1 ); createMenu( SMESHOp::OpExportMED, exportId, -1 ); @@ -4389,7 +4333,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createMenu( SMESHOp::OpExportCGNS, exportId, -1 ); #endif - createMenu( SMESHOp::OpExportSAUV, exportId, -1 ); createMenu( SMESHOp::OpExportGMF, exportId, -1 ); createMenu( separator(), fileId, 10 ); @@ -4782,7 +4725,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createPopupItem( SMESHOp::OpPopupExportCGNS, OB, mesh_group, multiple_non_empty, anId ); #endif - createPopupItem( SMESHOp::OpPopupExportSAUV, OB, mesh_group, only_one_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportGMF, OB, mesh_group, only_one_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportDAT, OB, mesh_group, only_one_non_empty, anId ); @@ -4793,7 +4735,6 @@ void SMESHGUI::initialize( CAM_Application* app ) #ifdef WITH_CGNS createPopupItem( SMESHOp::OpPopupImportCGNS, OB, smesh, "", anId ); #endif - createPopupItem( SMESHOp::OpPopupImportSAUV, OB, smesh, "", anId ); createPopupItem( SMESHOp::OpPopupImportGMF, OB, smesh, "", anId ); createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId ); popupMgr()->insert( separator(), -1, 0 ); @@ -5201,7 +5142,6 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) << wrap("MED", "li") << wrap("STL", "li") << wrap("CGNS", "li") - << wrap("SAUV", "li") << wrap("GMF", "li"); lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); items.clear(); diff --git a/src/SMESHGUI/SMESHGUI_Operations.h b/src/SMESHGUI/SMESHGUI_Operations.h index d1884f948..e24bcd558 100644 --- a/src/SMESHGUI/SMESHGUI_Operations.h +++ b/src/SMESHGUI/SMESHGUI_Operations.h @@ -40,14 +40,12 @@ namespace SMESHOp { OpImportMED = 1102, // MENU FILE - IMPORT - MED FILE OpImportSTL = 1103, // MENU FILE - IMPORT - STL FILE OpImportCGNS = 1104, // MENU FILE - IMPORT - CGNS FILE - OpImportSAUV = 1105, // MENU FILE - IMPORT - SAUV FILE OpImportGMF = 1106, // MENU FILE - IMPORT - GMF FILE OpPopupImportDAT = 1120, // POPUP MENU - IMPORT - DAT FILE OpPopupImportUNV = 1121, // POPUP MENU - IMPORT - UNV FILE OpPopupImportMED = 1122, // POPUP MENU - IMPORT - MED FILE OpPopupImportSTL = 1123, // POPUP MENU - IMPORT - STL FILE OpPopupImportCGNS = 1124, // POPUP MENU - IMPORT - CGNS FILE - OpPopupImportSAUV = 1125, // POPUP MENU - IMPORT - SAUV FILE OpPopupImportGMF = 1126, // POPUP MENU - IMPORT - GMF FILE // Export -------------------------//-------------------------------- OpExportDAT = 1200, // MENU FILE - EXPORT - DAT FILE @@ -55,14 +53,12 @@ namespace SMESHOp { OpExportUNV = 1202, // MENU FILE - EXPORT - UNV FILE OpExportSTL = 1203, // MENU FILE - EXPORT - STL FILE OpExportCGNS = 1204, // MENU FILE - EXPORT - CGNS FILE - OpExportSAUV = 1205, // MENU FILE - EXPORT - SAUV FILE OpExportGMF = 1206, // MENU FILE - EXPORT - GMF FILE OpPopupExportDAT = 1210, // POPUP MENU - EXPORT - DAT FILE OpPopupExportMED = 1211, // POPUP MENU - EXPORT - MED FILE OpPopupExportUNV = 1212, // POPUP MENU - EXPORT - UNV FILE OpPopupExportSTL = 1213, // POPUP MENU - EXPORT - STL FILE OpPopupExportCGNS = 1214, // POPUP MENU - EXPORT - CGNS FILE - OpPopupExportSAUV = 1215, // POPUP MENU - EXPORT - SAUV FILE OpPopupExportGMF = 1216, // POPUP MENU - EXPORT - GMF FILE // Mesh ---------------------------//-------------------------------- OpCreateMesh = 2030, // MENU MESH - CREATE MESH diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 9c982d71e..8c4e75870 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -11,10 +11,6 @@ MED_FILES_FILTER MED files - - SAUV_FILES_FILTER - SAUV files - IDEAS_FILES_FILTER IDEAS files @@ -648,10 +644,6 @@ MEN_EXPORT_GMF Export to GMF file - - MEN_EXPORT_SAUV - Export to SAUV file - MEN_EXPORT_STL Export to STL file @@ -876,14 +868,6 @@ MEN_GMF GMF file - - MEN_IMPORT_SAUV - SAUV file - - - MEN_SAUV - SAUV file - MEN_MERGE Merge Nodes @@ -3464,10 +3448,6 @@ Use Display Entity menu command to show them. STB_EXPORT_GMF Export to GMF file - - STB_EXPORT_SAUV - Export to SAUV file - STB_EXPORT_STL Export to STL file @@ -3600,14 +3580,6 @@ Use Display Entity menu command to show them. STB_GMF Export GMF file - - STB_IMPORT_SAUV - Import SAUV file - - - STB_SAUV - Export SAUV file - STB_MERGE Merge nodes @@ -4164,10 +4136,6 @@ Use Display Entity menu command to show them. TOP_EXPORT_MED Export to MED file - - TOP_EXPORT_SAUV - Export to SAUV file - TOP_EXPORT_STL Export to STL file @@ -4300,14 +4268,6 @@ Use Display Entity menu command to show them. TOP_GMF Export GMF file - - TOP_IMPORT_SAUV - Import SAUV file - - - TOP_SAUV - Export SAUV file - TOP_MERGE Merge nodes diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 992eab2df..93cfc53cb 100644 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -11,10 +11,6 @@ MED_FILES_FILTER Fichiers MED - - SAUV_FILES_FILTER - Fichiers SAUV - IDEAS_FILES_FILTER Fichiers IDEAS @@ -648,10 +644,6 @@ MEN_EXPORT_GMF Exporter au format GMF - - MEN_EXPORT_SAUV - Exporter au format SAUV (ASCII) - MEN_EXPORT_STL Exporter au format STL @@ -876,14 +868,6 @@ MEN_GMF Fichier GMF - - MEN_IMPORT_SAUV - Fichier SAUV (ASCII) - - - MEN_SAUV - Fichier SAUV (ASCII) - MEN_MERGE Fusionner les nœuds @@ -3451,10 +3435,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_EXPORT_GMF Exporter au format GMF - - STB_EXPORT_SAUV - Exporter au format SAUV (ASCII) - STB_EXPORT_STL Exporter au format STL @@ -3587,14 +3567,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher. STB_GMF Exporter un fichier GMF - - STB_IMPORT_SAUV - Importer un fichier SAUV (ASCII) - - - STB_SAUV - Exporter un fichier SAUV (ASCII) - STB_MERGE Fusionner les nœuds @@ -4151,10 +4123,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_EXPORT_MED Exporter au format MED - - TOP_EXPORT_SAUV - Exporter au format SAUV (ASCII) - TOP_EXPORT_STL Exporter au format STL @@ -4287,14 +4255,6 @@ Utilisez le menu "Visualiser une entité" pour les afficher. TOP_GMF Exporter un fichier GMF - - TOP_IMPORT_SAUV - Importer un fichier SAUV (ASCII) - - - TOP_SAUV - Exporter un fichier SAUV (ASCII) - TOP_MERGE Fusionner les nœuds diff --git a/src/SMESHGUI/SMESH_msg_ja.ts b/src/SMESHGUI/SMESH_msg_ja.ts index c1c0ae8c4..369b86a57 100644 --- a/src/SMESHGUI/SMESH_msg_ja.ts +++ b/src/SMESHGUI/SMESH_msg_ja.ts @@ -11,10 +11,6 @@ MED_FILES_FILTER MEDファイル - - SAUV_FILES_FILTER - SAUVファイル - IDEAS_FILES_FILTER IDEAS ファイル @@ -503,10 +499,6 @@ MEN_EXPORT_GMF GMF形式でエクスポート - - MEN_EXPORT_SAUV - SAUV (ASCII) 形式でエクスポート - MEN_EXPORT_STL STL形式でエクスポート @@ -727,14 +719,6 @@ MEN_GMF GMFファイル - - MEN_IMPORT_SAUV - SAUVファイル - - - MEN_SAUV - SAUVファイル - MEN_MERGE 節点の結合 @@ -3147,10 +3131,6 @@ STB_EXPORT_GMF 組み換えをエクスポートします。 - - STB_EXPORT_SAUV - SAUV (ASCII) 形式でエクスポート - STB_EXPORT_STL STL形式でエクスポート @@ -3279,14 +3259,6 @@ STB_GMF 組み換えファイルをエクスポートします。 - - STB_IMPORT_SAUV - バックアップ (ASCII) ファイルをインポートします。 - - - STB_SAUV - バックアップ (ASCII) ファイルをエクスポートします。 - STB_MERGE ノードを結合します。 @@ -3827,10 +3799,6 @@ TOP_EXPORT_MED MED形式でエクスポート - - TOP_EXPORT_SAUV - SAUV (ASCII) 形式でエクスポート - TOP_EXPORT_STL STL形式でエクスポート @@ -3959,14 +3927,6 @@ TOP_GMF 組み換えファイルをエクスポートします。 - - TOP_IMPORT_SAUV - バックアップ (ASCII) ファイルをインポートします。 - - - TOP_SAUV - バックアップ (ASCII) ファイルをエクスポートします。 - TOP_MERGE ノードを結合します。 diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index bd0ec817e..5f3456bb9 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1024,7 +1024,6 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) return; } if ( method == "CreateMeshesFromMED" || - method == "CreateMeshesFromSAUV"|| method == "CreateMeshesFromCGNS" || method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status ) { @@ -2194,7 +2193,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand ) static TStringSet sameMethods; if ( sameMethods.empty() ) { const char * names[] = - { "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents", + { "ExportDAT","ExportUNV","ExportSTL", "RemoveGroup","RemoveGroupWithContents", "GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId", "ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements", "NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles", diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 336c341ee..2632073a7 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1316,17 +1316,17 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMeshesFromUNV( const char* theFileName */ //============================================================================= -SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileName, - SMESH::DriverMED_ReadStatus& theStatus, - const char* theCommandNameForPython, - const char* theFileNameForPython) +SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName, + SMESH::DriverMED_ReadStatus& theStatus ) { + checkFileReadable( theFileName ); + #ifdef WIN32 char bname[ _MAX_FNAME ]; - _splitpath( theFileNameForPython, NULL, NULL, bname, NULL ); + _splitpath( theFileName, NULL, NULL, bname, NULL ); string aFileName = bname; #else - string aFileName = basename( const_cast(theFileNameForPython) ); + string aFileName = basename( const_cast( theFileName )); #endif // Retrieve mesh names from the file DriverMED_R_SMESHDS_Mesh myReader; @@ -1339,59 +1339,57 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa { // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups() - // Python Dump - TPythonDump aPythonDump(this); - aPythonDump << "(["; + // Python Dump + TPythonDump aPythonDump(this); + aPythonDump << "(["; - if (theStatus == SMESH::DRS_OK) { - SALOMEDS::StudyBuilder_var aStudyBuilder; - aStudyBuilder = getStudyServant()->NewBuilder(); - aStudyBuilder->NewCommand(); // There is a transaction + if (theStatus == SMESH::DRS_OK) + { + SALOMEDS::StudyBuilder_var aStudyBuilder; + aStudyBuilder = getStudyServant()->NewBuilder(); + aStudyBuilder->NewCommand(); // There is a transaction - aResult->length( aNames.size() ); - int i = 0; + aResult->length( aNames.size() ); + int i = 0; - // Iterate through all meshes and create mesh objects - for ( list::iterator it = aNames.begin(); it != aNames.end(); it++ ) - { - // Python Dump - if (i > 0) aPythonDump << ", "; - - // create mesh - SMESH::SMESH_Mesh_var mesh = createMesh(); - - // publish mesh in the study - SALOMEDS::SObject_wrap aSO; - if ( CanPublishInStudy( mesh ) ) - // little trick: for MED file theFileName and theFileNameForPython are the same, but they are different for SAUV - // - as names of meshes are stored in MED file, we use them for data publishing - // - as mesh name is not stored in UNV file, we use file name as name of mesh when publishing data - aSO = PublishMesh( mesh.in(), ( theFileName == theFileNameForPython ) ? (*it).c_str() : aFileName.c_str() ); - - // Python Dump - if ( !aSO->_is_nil() ) { - aPythonDump << aSO; - } else { - aPythonDump << "mesh_" << i; - } + // Iterate through all meshes and create mesh objects + for ( const std::string & meshName : aNames ) + { + // Python Dump + if (i > 0) aPythonDump << ", "; - // Read mesh data (groups are published automatically by ImportMEDFile()) - SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( mesh ).in() ); - ASSERT( meshServant ); - SMESH::DriverMED_ReadStatus status1 = - meshServant->ImportMEDFile( theFileName, (*it).c_str() ); - if (status1 > theStatus) - theStatus = status1; + // create mesh + SMESH::SMESH_Mesh_var mesh = createMesh(); + + // publish mesh in the study + SALOMEDS::SObject_wrap aSO; + if ( CanPublishInStudy( mesh ) ) + aSO = PublishMesh( mesh.in(), meshName.c_str() ); + + // Python Dump + if ( !aSO->_is_nil() ) { + aPythonDump << aSO; + } else { + aPythonDump << "mesh_" << i; + } + + // Read mesh data (groups are published automatically by ImportMEDFile()) + SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( mesh ).in() ); + ASSERT( meshServant ); + SMESH::DriverMED_ReadStatus status1 = + meshServant->ImportMEDFile( theFileName, meshName.c_str() ); + if (status1 > theStatus) + theStatus = status1; - aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh ); - meshServant->GetImpl().GetMeshDS()->Modified(); + aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh ); + meshServant->GetImpl().GetMeshDS()->Modified(); + } + if ( !aStudyBuilder->_is_nil() ) + aStudyBuilder->CommitCommand(); } - if ( !aStudyBuilder->_is_nil() ) - aStudyBuilder->CommitCommand(); - } - // Update Python script - aPythonDump << "], status) = " << this << "." << theCommandNameForPython << "(r'" << theFileNameForPython << "')"; + // Update Python script + aPythonDump << "], status) = " << this << ".CreateMeshesFromMED( r'" << theFileName << "' )"; } // Dump creation of groups for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) @@ -1400,66 +1398,6 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMEDorSAUV( const char* theFileNa return aResult._retn(); } -//================================================================================ -/*! - * \brief Create meshes by reading a MED file - */ -//================================================================================ - -SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName, - SMESH::DriverMED_ReadStatus& theStatus) -{ - Unexpect aCatch(SALOME_SalomeException); - checkFileReadable( theFileName ); - - SMESH::mesh_array* result = CreateMeshesFromMEDorSAUV(theFileName, theStatus, - "CreateMeshesFromMED", theFileName); - return result; -} - -//============================================================================= -/*! - * SMESH_Gen_i::CreateMeshFromSAUV - * - * Create mesh and import data from SAUV file - */ -//============================================================================= - -SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromSAUV( const char* theFileName, - SMESH::DriverMED_ReadStatus& theStatus) -{ - Unexpect aCatch(SALOME_SalomeException); - checkFileReadable( theFileName ); - - std::string sauvfilename(theFileName); - std::string medfilename(theFileName); - medfilename += ".med"; - std::string cmd; -#ifdef WIN32 - cmd = "%PYTHONBIN% "; -#else - cmd = "python3 "; -#endif - cmd += "-c \""; - cmd += "from medutilities import convert ; convert(r'" + sauvfilename + "', 'GIBI', 'MED', 1, r'" + medfilename + "')"; - cmd += "\""; - system(cmd.c_str()); - SMESH::mesh_array* result = CreateMeshesFromMEDorSAUV(medfilename.c_str(), - theStatus, - "CreateMeshesFromSAUV", - sauvfilename.c_str()); -#ifdef WIN32 - cmd = "%PYTHONBIN% "; -#else - cmd = "python3 "; -#endif - cmd += "-c \""; - cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')"; - cmd += "\""; - system(cmd.c_str()); - return result; -} - //============================================================================= /*! * SMESH_Gen_i::CreateMeshFromSTL diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 648b1d2f5..9caaa543c 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -241,10 +241,6 @@ public: SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName, SMESH::DriverMED_ReadStatus& theStatus ); - // Create mesh(es) and import data from MED file - SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName, - SMESH::DriverMED_ReadStatus& theStatus ); - // Create a mesh and import data from a STL file SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName ); @@ -641,11 +637,6 @@ private: void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid ); - SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName, - SMESH::DriverMED_ReadStatus& theStatus, - const char* theCommandNameForPython, - const char* theFileNameForPython); - std::vector _GetInside(SMESH::SMESH_IDSource_ptr meshPart, SMESH::ElementType ElemType, const TopoDS_Shape& Shape, diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index c63eccd3b..99e45c66e 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -3797,27 +3797,6 @@ CORBA::LongLong SMESH_Mesh_i::ExportMEDCoupling(CORBA::Boolean auto_groups, CORB return reinterpret_cast(ret); } -//================================================================================ -/*! - * \brief Export a mesh to a SAUV file - */ -//================================================================================ - -void SMESH_Mesh_i::ExportSAUV( const char* file, CORBA::Boolean auto_groups ) -{ - SMESH_TRY; - if ( _preMeshInfo ) - _preMeshInfo->FullLoadFromFile(); - - string aMeshName = prepareMeshNameAndGroups(file, true); - TPythonDump() << SMESH::SMESH_Mesh_var( _this()) - << ".ExportSAUV( r'" << file << "', " << auto_groups << " )"; - _impl->ExportSAUV(file, aMeshName.c_str(), auto_groups); - - SMESH_CATCH( SMESH::throwCorbaException ); -} - - //================================================================================ /*! * \brief Export a mesh to a DAT file diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index a2c428656..36e18d1be 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -215,8 +215,6 @@ public: CORBA::LongLong ExportMEDCoupling(CORBA::Boolean auto_groups, CORBA::Boolean autoDimension = true); - void ExportSAUV( const char* file, CORBA::Boolean auto_groups ); - void ExportDAT( const char* file, const CORBA::Boolean renumber ); void ExportUNV( const char* file, const CORBA::Boolean renumber ); void ExportSTL( const char* file, bool isascii ); diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 820e2e1af..47744206c 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -685,18 +685,6 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ): aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ] return aMeshes, aStatus - def CreateMeshesFromSAUV( self,theFileName ): - """ - Create a Mesh object(s) importing data from the given SAUV file - - Returns: - a tuple ( list of class :class:`Mesh` instances, :class:`SMESH.DriverMED_ReadStatus` ) - """ - - aSmeshMeshes, aStatus = SMESH._objref_SMESH_Gen.CreateMeshesFromSAUV(self,theFileName) - aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ] - return aMeshes, aStatus - def CreateMeshesFromSTL( self, theFileName ): """ Create a Mesh object importing data from the given STL file @@ -2456,20 +2444,6 @@ class Mesh(metaclass = MeshMeta): else: self.mesh.ExportMED(fileName, auto_groups, version, overwrite, autoDimension) - def ExportSAUV(self, f, auto_groups=0): - """ - Export the mesh in a file in SAUV format - - - Parameters: - f: is the file name - auto_groups: boolean parameter for creating/not creating - the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; - the typical use is auto_groups=False. - """ - - self.mesh.ExportSAUV(f, auto_groups) - def ExportDAT(self, f, meshPart=None, renumber=True): """ Export the mesh in a file in DAT format -- 2.30.2