bos #26432 [CEA 26431] import/export SAUV removal

This commit is contained in:
eap 2021-10-20 14:48:04 +03:00
parent 24a076474b
commit 1fdfb2587a
19 changed files with 73 additions and 449 deletions

View File

@ -23,7 +23,7 @@ Mesh module provides several ways to create the mesh:
* Bottom-up way, using :ref:`mesh modification <modifying_meshes_page>` operations, especially :ref:`extrusion <extrusion_page>` and :ref:`revolution <revolution_page>`. To create an empty mesh not based on geometry, use the same dialog as to :ref:`construct the mesh on geometry <constructing_meshes_page>` but specify neither the geometry nor meshing algorithms. * Bottom-up way, using :ref:`mesh modification <modifying_meshes_page>` operations, especially :ref:`extrusion <extrusion_page>` and :ref:`revolution <revolution_page>`. To create an empty mesh not based on geometry, use the same dialog as to :ref:`construct the mesh on geometry <constructing_meshes_page>` but specify neither the geometry nor meshing algorithms.
* The mesh can be :ref:`imported <importing_exporting_meshes_page>` from (and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and SAUVE formats. * The mesh can be :ref:`imported <importing_exporting_meshes_page>` 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 <importing_exporting_meshes_page>` or created in other way. To setup the meshing parameters of a mesh not based on geometry, just invoke :ref:`Edit mesh / sub-mesh <editing_meshes_page>` command on your 2D mesh. * The 3D mesh can be generated from the 2D mesh not based on geometry, which was either :ref:`imported <importing_exporting_meshes_page>` or created in other way. To setup the meshing parameters of a mesh not based on geometry, just invoke :ref:`Edit mesh / sub-mesh <editing_meshes_page>` command on your 2D mesh.

View File

@ -8,7 +8,6 @@ Importing and exporting meshes
In MESH there is a functionality allowing import/export of meshes in the following formats: In MESH there is a functionality allowing import/export of meshes in the following formats:
* **MED**, * **MED**,
* **SAUV** (format of the CASTEM code),
* **UNV** (I-DEAS 10), * **UNV** (I-DEAS 10),
* **STL**, * **STL**,
* **CGNS**, * **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. 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: .. _export_auto_groups:

View File

@ -25,13 +25,11 @@ Importing and exporting meshes
smeshBuilder.CreateMeshesFromSTL smeshBuilder.CreateMeshesFromSTL
smeshBuilder.CreateMeshesFromCGNS smeshBuilder.CreateMeshesFromCGNS
smeshBuilder.CreateMeshesFromGMF smeshBuilder.CreateMeshesFromGMF
smeshBuilder.CreateMeshesFromSAUV
Mesh.ExportMED Mesh.ExportMED
Mesh.ExportUNV Mesh.ExportUNV
Mesh.ExportSTL Mesh.ExportSTL
Mesh.ExportCGNS Mesh.ExportCGNS
Mesh.ExportDAT Mesh.ExportDAT
Mesh.ExportSAUV
Mesh.ExportGMF Mesh.ExportGMF

View File

@ -253,16 +253,9 @@ module SMESH
/*! /*!
* Create Mesh object(s) importing data from given MED file * Create Mesh object(s) importing data from given MED file
*/ */
mesh_array CreateMeshesFromMED( in string theFileName, mesh_array CreateMeshesFromMED( in string theFileName,
out SMESH::DriverMED_ReadStatus theStatus ) out SMESH::DriverMED_ReadStatus theStatus )
raises ( SALOME::SALOME_Exception ); 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 );
/*! /*!
* Create Mesh object importing data from given STL file * Create Mesh object importing data from given STL file

View File

@ -714,18 +714,11 @@ module SMESH
in double ZTolerance, in double ZTolerance,
in boolean saveNumbers) raises (SALOME::SALOME_Exception); 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 * Return string representation of a MED file version comprising nbDigits
*/ */
string GetVersionString(in long minor, in short nbDigits); string GetVersionString(in long minor, in short nbDigits);
/*! /*!
* Return the list of med versions compatibles for write/append, * 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) * encoded in 10*major+minor (for instance, code for med 3.2.1 is 32)

View File

@ -166,21 +166,6 @@ void DriverMED_W_SMESHDS_Mesh::AddGroupOfBalls()
myDoGroupOfBalls = true; 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 namespace
{ {

View File

@ -64,7 +64,6 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
void AddGroupOfVolumes(); void AddGroupOfVolumes();
void AddGroupOf0DElems(); void AddGroupOf0DElems();
void AddGroupOfBalls(); void AddGroupOfBalls();
void AddAllToGroup();
/*! functions to prepare adding one mesh /*! functions to prepare adding one mesh
*/ */

View File

@ -1416,8 +1416,7 @@ void SMESH_Mesh::exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& theWriter,
bool theAutoDimension, bool theAutoDimension,
bool theAddODOnVertices, bool theAddODOnVertices,
double theZTolerance, double theZTolerance,
bool theSaveNumbers, bool theSaveNumbers)
bool theAllElemsToGroup)
{ {
Driver_Mesh::Status status = Driver_Mesh::DRS_OK; Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
@ -1443,8 +1442,6 @@ void SMESH_Mesh::exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& theWriter,
theWriter.AddGroupOf0DElems(); theWriter.AddGroupOf0DElems();
theWriter.AddGroupOfBalls(); theWriter.AddGroupOfBalls();
} }
if ( theAllElemsToGroup )
theWriter.AddAllToGroup();
// Pass groups to writer. Provide unique group names. // Pass groups to writer. Provide unique group names.
//set<string> aGroupNames; // Corrected for Mantis issue 0020028 //set<string> aGroupNames; // Corrected for Mantis issue 0020028
@ -1499,8 +1496,7 @@ SMESH_Mesh::ExportMEDCoupling(const char* theMeshName,
{ {
DriverMED_W_SMESHDS_Mesh_Mem writer; DriverMED_W_SMESHDS_Mesh_Mem writer;
this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension,
theAddODOnVertices, theZTolerance, theSaveNumbers, theAddODOnVertices, theZTolerance, theSaveNumbers);
/*AllElemsToGroup(for ExportSAUV())=*/false);
return writer.getData(); return writer.getData();
} }
@ -1525,8 +1521,6 @@ SMESH_Mesh::ExportMEDCoupling(const char* theMeshName,
* within a given tolerance, the coordinate is set to zero. * within a given tolerance, the coordinate is set to zero.
* If \a ZTolerance is negative, the node coordinates are kept as is. * If \a ZTolerance is negative, the node coordinates are kept as is.
* \param [in] theSaveNumbers : enable saving numbers of nodes and cells. * \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 * \return int - mesh index in the file
*/ */
//================================================================================ //================================================================================
@ -1539,65 +1533,12 @@ void SMESH_Mesh::ExportMED(const char * theFile,
bool theAutoDimension, bool theAutoDimension,
bool theAddODOnVertices, bool theAddODOnVertices,
double theZTolerance, double theZTolerance,
bool theSaveNumbers, bool theSaveNumbers)
bool theAllElemsToGroup)
{ {
MESSAGE("MED_VERSION:"<< theVersion); MESSAGE("MED_VERSION:"<< theVersion);
DriverMED_W_SMESHDS_Mesh writer; DriverMED_W_SMESHDS_Mesh writer;
writer.SetFile( theFile, theVersion ); writer.SetFile( theFile, theVersion );
this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers, theAllElemsToGroup ); this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers );
}
//================================================================================
/*!
* \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());
} }
//================================================================================ //================================================================================

View File

@ -282,8 +282,7 @@ class SMESH_EXPORT SMESH_Mesh
bool theAutoDimension = false, bool theAutoDimension = false,
bool theAddODOnVertices = false, bool theAddODOnVertices = false,
double theZTolerance = -1., double theZTolerance = -1.,
bool theSaveNumbers = true, bool theSaveNumbers = true);
bool theAllElemsToGroup = false);
void ExportDAT(const char * file, void ExportDAT(const char * file,
const SMESHDS_Mesh* meshPart = 0, const SMESHDS_Mesh* meshPart = 0,
@ -302,9 +301,6 @@ class SMESH_EXPORT SMESH_Mesh
void ExportGMF(const char * file, void ExportGMF(const char * file,
const SMESHDS_Mesh* mesh, const SMESHDS_Mesh* mesh,
bool withRequiredGroups = true ); bool withRequiredGroups = true );
void ExportSAUV(const char *file,
const char* theMeshName = NULL,
bool theAutoGroups = true);
double GetComputeProgress() const; double GetComputeProgress() const;
@ -395,8 +391,7 @@ private:
bool theAutoDimension, bool theAutoDimension,
bool theAddODOnVertices, bool theAddODOnVertices,
double theZTolerance, double theZTolerance,
bool theSaveNumbers, bool theSaveNumbers);
bool theAllElemsToGroup);
private: private:
void fillAncestorsMap(const TopoDS_Shape& theShape); void fillAncestorsMap(const TopoDS_Shape& theShape);

View File

@ -239,11 +239,6 @@ namespace
theCommandID == SMESHOp::OpPopupImportCGNS ) { theCommandID == SMESHOp::OpPopupImportCGNS ) {
filter.append( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" ); 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 || else if ( theCommandID == SMESHOp::OpImportGMF ||
theCommandID == SMESHOp::OpPopupImportGMF ) { theCommandID == SMESHOp::OpPopupImportGMF ) {
filter.append( QObject::tr( "GMF_ASCII_FILES_FILTER" ) + " (*.mesh)" ); filter.append( QObject::tr( "GMF_ASCII_FILES_FILTER" ) + " (*.mesh)" );
@ -345,18 +340,6 @@ namespace
} }
break; 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::OpImportGMF:
case SMESHOp::OpPopupImportGMF: case SMESHOp::OpPopupImportGMF:
{ {
@ -448,8 +431,6 @@ namespace
theCommandID == SMESHOp::OpPopupExportSTL ); theCommandID == SMESHOp::OpPopupExportSTL );
const bool isCGNS= ( theCommandID == SMESHOp::OpExportCGNS || const bool isCGNS= ( theCommandID == SMESHOp::OpExportCGNS ||
theCommandID == SMESHOp::OpPopupExportCGNS ); theCommandID == SMESHOp::OpPopupExportCGNS );
const bool isSAUV= ( theCommandID == SMESHOp::OpExportSAUV ||
theCommandID == SMESHOp::OpPopupExportSAUV );
const bool isGMF = ( theCommandID == SMESHOp::OpExportGMF || const bool isGMF = ( theCommandID == SMESHOp::OpExportGMF ||
theCommandID == SMESHOp::OpPopupExportGMF ); theCommandID == SMESHOp::OpPopupExportGMF );
@ -529,7 +510,7 @@ namespace
SMESH::SMESH_Mesh_var aMesh = aMeshOrGroup->GetMesh(); SMESH::SMESH_Mesh_var aMesh = aMeshOrGroup->GetMesh();
QString aMeshName = (*aMeshIter).second; 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 // check for equal group names within each mesh
for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) { for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
@ -581,18 +562,6 @@ namespace
format = "CGNS"; format = "CGNS";
notSupportedElemTypes.push_back( SMESH::Entity_Ball ); 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 ) else if ( isGMF )
{ {
format = "GMF"; format = "GMF";
@ -741,26 +710,19 @@ namespace
} }
delete fd; delete fd;
} }
else if ( isMED || isSAUV ) // Export to MED or SAUV else if ( isMED ) // Export to MED
{ {
int defaultVersion = 0; int defaultVersion = 0;
QMap<QString, int> aFilterMap; QMap<QString, int> aFilterMap;
if ( isMED ) { //filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)";
//filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)"; //QString vmed (aMesh->GetVersionString(-1, 2));
//QString vmed (aMesh->GetVersionString(-1, 2)); SMESH::long_array_var mvok = aMesh->GetMEDVersionsCompatibleForAppend();
SMESH::long_array_var mvok = aMesh->GetMEDVersionsCompatibleForAppend(); if ( mvok->length() > 0)
if ( mvok->length() > 0) defaultVersion = mvok[0]; // the current version to set the default filter on it
defaultVersion = mvok[0]; // the current version to set the default filter on it for ( CORBA::ULong i = 0; i < mvok->length(); ++i )
for ( CORBA::ULong i = 0; i < mvok->length(); ++i ) {
{ QString vs = (char*)( SMESH_Comment( mvok[i]/10 ) << "." << mvok[i]%10 );
QString vs = (char*)( SMESH_Comment( mvok[i]/10 ) << "." << mvok[i]%10 ); aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)", mvok[i]);
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 );
} }
QStringList filters; QStringList filters;
QMap<QString, int>::const_iterator it = aFilterMap.begin(); QMap<QString, int>::const_iterator it = aFilterMap.begin();
@ -946,15 +908,6 @@ namespace
fields, geoAssFields.toLatin1().data(), zTol, saveNumbers ); 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 ) else if ( isDAT )
{ {
if ( aMeshOrGroup->_is_equivalent( aMesh )) if ( aMeshOrGroup->_is_equivalent( aMesh ))
@ -2599,14 +2552,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case SMESHOp::OpImportMED: case SMESHOp::OpImportMED:
case SMESHOp::OpImportSTL: case SMESHOp::OpImportSTL:
case SMESHOp::OpImportCGNS: case SMESHOp::OpImportCGNS:
case SMESHOp::OpImportSAUV:
case SMESHOp::OpImportGMF: case SMESHOp::OpImportGMF:
case SMESHOp::OpPopupImportDAT: case SMESHOp::OpPopupImportDAT:
case SMESHOp::OpPopupImportUNV: case SMESHOp::OpPopupImportUNV:
case SMESHOp::OpPopupImportMED: case SMESHOp::OpPopupImportMED:
case SMESHOp::OpPopupImportSTL: case SMESHOp::OpPopupImportSTL:
case SMESHOp::OpPopupImportCGNS: case SMESHOp::OpPopupImportCGNS:
case SMESHOp::OpPopupImportSAUV:
case SMESHOp::OpPopupImportGMF: case SMESHOp::OpPopupImportGMF:
{ {
if(isStudyLocked()) break; if(isStudyLocked()) break;
@ -2637,14 +2588,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case SMESHOp::OpExportUNV: case SMESHOp::OpExportUNV:
case SMESHOp::OpExportSTL: case SMESHOp::OpExportSTL:
case SMESHOp::OpExportCGNS: case SMESHOp::OpExportCGNS:
case SMESHOp::OpExportSAUV:
case SMESHOp::OpExportGMF: case SMESHOp::OpExportGMF:
case SMESHOp::OpPopupExportDAT: case SMESHOp::OpPopupExportDAT:
case SMESHOp::OpPopupExportMED: case SMESHOp::OpPopupExportMED:
case SMESHOp::OpPopupExportUNV: case SMESHOp::OpPopupExportUNV:
case SMESHOp::OpPopupExportSTL: case SMESHOp::OpPopupExportSTL:
case SMESHOp::OpPopupExportCGNS: case SMESHOp::OpPopupExportCGNS:
case SMESHOp::OpPopupExportSAUV:
case SMESHOp::OpPopupExportGMF: case SMESHOp::OpPopupExportGMF:
{ {
::ExportMeshToFile(theCommandID); ::ExportMeshToFile(theCommandID);
@ -4114,7 +4063,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpImportCGNS, "IMPORT_CGNS" ); createSMESHAction( SMESHOp::OpImportCGNS, "IMPORT_CGNS" );
#endif #endif
createSMESHAction( SMESHOp::OpImportSAUV, "IMPORT_SAUV" );
createSMESHAction( SMESHOp::OpImportGMF, "IMPORT_GMF" ); createSMESHAction( SMESHOp::OpImportGMF, "IMPORT_GMF" );
createSMESHAction( SMESHOp::OpPopupImportUNV, "IMPORT_UNV"); createSMESHAction( SMESHOp::OpPopupImportUNV, "IMPORT_UNV");
createSMESHAction( SMESHOp::OpPopupImportMED, "IMPORT_MED"); createSMESHAction( SMESHOp::OpPopupImportMED, "IMPORT_MED");
@ -4122,7 +4070,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" ); createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" );
#endif #endif
createSMESHAction( SMESHOp::OpPopupImportSAUV, "IMPORT_SAUV" );
createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" ); createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" );
createSMESHAction( SMESHOp::OpExportDAT, "DAT" ); createSMESHAction( SMESHOp::OpExportDAT, "DAT" );
@ -4132,7 +4079,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpExportCGNS, "CGNS"); createSMESHAction( SMESHOp::OpExportCGNS, "CGNS");
#endif #endif
createSMESHAction( SMESHOp::OpExportSAUV, "SAUV");
createSMESHAction( SMESHOp::OpExportGMF, "GMF" ); createSMESHAction( SMESHOp::OpExportGMF, "GMF" );
createSMESHAction( SMESHOp::OpPopupExportDAT, "DAT" ); createSMESHAction( SMESHOp::OpPopupExportDAT, "DAT" );
createSMESHAction( SMESHOp::OpPopupExportMED, "MED" ); createSMESHAction( SMESHOp::OpPopupExportMED, "MED" );
@ -4141,7 +4087,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpPopupExportCGNS, "CGNS"); createSMESHAction( SMESHOp::OpPopupExportCGNS, "CGNS");
#endif #endif
createSMESHAction( SMESHOp::OpPopupExportSAUV, "SAUV");
createSMESHAction( SMESHOp::OpPopupExportGMF, "GMF" ); createSMESHAction( SMESHOp::OpPopupExportGMF, "GMF" );
createSMESHAction( SMESHOp::OpFileInformation, "FILE_INFO" ); createSMESHAction( SMESHOp::OpFileInformation, "FILE_INFO" );
createSMESHAction( SMESHOp::OpDelete, "DELETE", "ICON_DELETE", Qt::Key_Delete ); createSMESHAction( SMESHOp::OpDelete, "DELETE", "ICON_DELETE", Qt::Key_Delete );
@ -4380,7 +4325,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createMenu( SMESHOp::OpImportCGNS, importId, -1 ); createMenu( SMESHOp::OpImportCGNS, importId, -1 );
#endif #endif
createMenu( SMESHOp::OpImportSAUV, importId, -1 );
createMenu( SMESHOp::OpImportGMF, importId, -1 ); createMenu( SMESHOp::OpImportGMF, importId, -1 );
createMenu( SMESHOp::OpExportDAT, exportId, -1 ); createMenu( SMESHOp::OpExportDAT, exportId, -1 );
createMenu( SMESHOp::OpExportMED, exportId, -1 ); createMenu( SMESHOp::OpExportMED, exportId, -1 );
@ -4389,7 +4333,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createMenu( SMESHOp::OpExportCGNS, exportId, -1 ); createMenu( SMESHOp::OpExportCGNS, exportId, -1 );
#endif #endif
createMenu( SMESHOp::OpExportSAUV, exportId, -1 );
createMenu( SMESHOp::OpExportGMF, exportId, -1 ); createMenu( SMESHOp::OpExportGMF, exportId, -1 );
createMenu( separator(), fileId, 10 ); createMenu( separator(), fileId, 10 );
@ -4782,7 +4725,6 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifdef WITH_CGNS #ifdef WITH_CGNS
createPopupItem( SMESHOp::OpPopupExportCGNS, OB, mesh_group, multiple_non_empty, anId ); createPopupItem( SMESHOp::OpPopupExportCGNS, OB, mesh_group, multiple_non_empty, anId );
#endif #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::OpPopupExportGMF, OB, mesh_group, only_one_non_empty, anId );
createPopupItem( SMESHOp::OpPopupExportDAT, 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 #ifdef WITH_CGNS
createPopupItem( SMESHOp::OpPopupImportCGNS, OB, smesh, "", anId ); createPopupItem( SMESHOp::OpPopupImportCGNS, OB, smesh, "", anId );
#endif #endif
createPopupItem( SMESHOp::OpPopupImportSAUV, OB, smesh, "", anId );
createPopupItem( SMESHOp::OpPopupImportGMF, OB, smesh, "", anId ); createPopupItem( SMESHOp::OpPopupImportGMF, OB, smesh, "", anId );
createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId ); createPopupItem( SMESHOp::OpPopupImportDAT, OB, smesh, "", anId );
popupMgr()->insert( separator(), -1, 0 ); popupMgr()->insert( separator(), -1, 0 );
@ -5201,7 +5142,6 @@ bool SMESHGUI::activateModule( SUIT_Study* study )
<< wrap("MED", "li") << wrap("MED", "li")
<< wrap("STL", "li") << wrap("STL", "li")
<< wrap("CGNS", "li") << wrap("CGNS", "li")
<< wrap("SAUV", "li")
<< wrap("GMF", "li"); << wrap("GMF", "li");
lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul");
items.clear(); items.clear();

View File

@ -40,14 +40,12 @@ namespace SMESHOp {
OpImportMED = 1102, // MENU FILE - IMPORT - MED FILE OpImportMED = 1102, // MENU FILE - IMPORT - MED FILE
OpImportSTL = 1103, // MENU FILE - IMPORT - STL FILE OpImportSTL = 1103, // MENU FILE - IMPORT - STL FILE
OpImportCGNS = 1104, // MENU FILE - IMPORT - CGNS FILE OpImportCGNS = 1104, // MENU FILE - IMPORT - CGNS FILE
OpImportSAUV = 1105, // MENU FILE - IMPORT - SAUV FILE
OpImportGMF = 1106, // MENU FILE - IMPORT - GMF FILE OpImportGMF = 1106, // MENU FILE - IMPORT - GMF FILE
OpPopupImportDAT = 1120, // POPUP MENU - IMPORT - DAT FILE OpPopupImportDAT = 1120, // POPUP MENU - IMPORT - DAT FILE
OpPopupImportUNV = 1121, // POPUP MENU - IMPORT - UNV FILE OpPopupImportUNV = 1121, // POPUP MENU - IMPORT - UNV FILE
OpPopupImportMED = 1122, // POPUP MENU - IMPORT - MED FILE OpPopupImportMED = 1122, // POPUP MENU - IMPORT - MED FILE
OpPopupImportSTL = 1123, // POPUP MENU - IMPORT - STL FILE OpPopupImportSTL = 1123, // POPUP MENU - IMPORT - STL FILE
OpPopupImportCGNS = 1124, // POPUP MENU - IMPORT - CGNS FILE OpPopupImportCGNS = 1124, // POPUP MENU - IMPORT - CGNS FILE
OpPopupImportSAUV = 1125, // POPUP MENU - IMPORT - SAUV FILE
OpPopupImportGMF = 1126, // POPUP MENU - IMPORT - GMF FILE OpPopupImportGMF = 1126, // POPUP MENU - IMPORT - GMF FILE
// Export -------------------------//-------------------------------- // Export -------------------------//--------------------------------
OpExportDAT = 1200, // MENU FILE - EXPORT - DAT FILE OpExportDAT = 1200, // MENU FILE - EXPORT - DAT FILE
@ -55,14 +53,12 @@ namespace SMESHOp {
OpExportUNV = 1202, // MENU FILE - EXPORT - UNV FILE OpExportUNV = 1202, // MENU FILE - EXPORT - UNV FILE
OpExportSTL = 1203, // MENU FILE - EXPORT - STL FILE OpExportSTL = 1203, // MENU FILE - EXPORT - STL FILE
OpExportCGNS = 1204, // MENU FILE - EXPORT - CGNS FILE OpExportCGNS = 1204, // MENU FILE - EXPORT - CGNS FILE
OpExportSAUV = 1205, // MENU FILE - EXPORT - SAUV FILE
OpExportGMF = 1206, // MENU FILE - EXPORT - GMF FILE OpExportGMF = 1206, // MENU FILE - EXPORT - GMF FILE
OpPopupExportDAT = 1210, // POPUP MENU - EXPORT - DAT FILE OpPopupExportDAT = 1210, // POPUP MENU - EXPORT - DAT FILE
OpPopupExportMED = 1211, // POPUP MENU - EXPORT - MED FILE OpPopupExportMED = 1211, // POPUP MENU - EXPORT - MED FILE
OpPopupExportUNV = 1212, // POPUP MENU - EXPORT - UNV FILE OpPopupExportUNV = 1212, // POPUP MENU - EXPORT - UNV FILE
OpPopupExportSTL = 1213, // POPUP MENU - EXPORT - STL FILE OpPopupExportSTL = 1213, // POPUP MENU - EXPORT - STL FILE
OpPopupExportCGNS = 1214, // POPUP MENU - EXPORT - CGNS FILE OpPopupExportCGNS = 1214, // POPUP MENU - EXPORT - CGNS FILE
OpPopupExportSAUV = 1215, // POPUP MENU - EXPORT - SAUV FILE
OpPopupExportGMF = 1216, // POPUP MENU - EXPORT - GMF FILE OpPopupExportGMF = 1216, // POPUP MENU - EXPORT - GMF FILE
// Mesh ---------------------------//-------------------------------- // Mesh ---------------------------//--------------------------------
OpCreateMesh = 2030, // MENU MESH - CREATE MESH OpCreateMesh = 2030, // MENU MESH - CREATE MESH

View File

@ -11,10 +11,6 @@
<source>MED_FILES_FILTER</source> <source>MED_FILES_FILTER</source>
<translation>MED files</translation> <translation>MED files</translation>
</message> </message>
<message>
<source>SAUV_FILES_FILTER</source>
<translation>SAUV files</translation>
</message>
<message> <message>
<source>IDEAS_FILES_FILTER</source> <source>IDEAS_FILES_FILTER</source>
<translation>IDEAS files</translation> <translation>IDEAS files</translation>
@ -648,10 +644,6 @@
<source>MEN_EXPORT_GMF</source> <source>MEN_EXPORT_GMF</source>
<translation>Export to GMF file</translation> <translation>Export to GMF file</translation>
</message> </message>
<message>
<source>MEN_EXPORT_SAUV</source>
<translation>Export to SAUV file</translation>
</message>
<message> <message>
<source>MEN_EXPORT_STL</source> <source>MEN_EXPORT_STL</source>
<translation>Export to STL file</translation> <translation>Export to STL file</translation>
@ -876,14 +868,6 @@
<source>MEN_GMF</source> <source>MEN_GMF</source>
<translation>GMF file</translation> <translation>GMF file</translation>
</message> </message>
<message>
<source>MEN_IMPORT_SAUV</source>
<translation>SAUV file</translation>
</message>
<message>
<source>MEN_SAUV</source>
<translation>SAUV file</translation>
</message>
<message> <message>
<source>MEN_MERGE</source> <source>MEN_MERGE</source>
<translation>Merge Nodes</translation> <translation>Merge Nodes</translation>
@ -3464,10 +3448,6 @@ Use Display Entity menu command to show them.
<source>STB_EXPORT_GMF</source> <source>STB_EXPORT_GMF</source>
<translation>Export to GMF file</translation> <translation>Export to GMF file</translation>
</message> </message>
<message>
<source>STB_EXPORT_SAUV</source>
<translation>Export to SAUV file</translation>
</message>
<message> <message>
<source>STB_EXPORT_STL</source> <source>STB_EXPORT_STL</source>
<translation>Export to STL file</translation> <translation>Export to STL file</translation>
@ -3600,14 +3580,6 @@ Use Display Entity menu command to show them.
<source>STB_GMF</source> <source>STB_GMF</source>
<translation>Export GMF file</translation> <translation>Export GMF file</translation>
</message> </message>
<message>
<source>STB_IMPORT_SAUV</source>
<translation>Import SAUV file</translation>
</message>
<message>
<source>STB_SAUV</source>
<translation>Export SAUV file</translation>
</message>
<message> <message>
<source>STB_MERGE</source> <source>STB_MERGE</source>
<translation>Merge nodes</translation> <translation>Merge nodes</translation>
@ -4164,10 +4136,6 @@ Use Display Entity menu command to show them.
<source>TOP_EXPORT_MED</source> <source>TOP_EXPORT_MED</source>
<translation>Export to MED file</translation> <translation>Export to MED file</translation>
</message> </message>
<message>
<source>TOP_EXPORT_SAUV</source>
<translation>Export to SAUV file</translation>
</message>
<message> <message>
<source>TOP_EXPORT_STL</source> <source>TOP_EXPORT_STL</source>
<translation>Export to STL file</translation> <translation>Export to STL file</translation>
@ -4300,14 +4268,6 @@ Use Display Entity menu command to show them.
<source>TOP_GMF</source> <source>TOP_GMF</source>
<translation>Export GMF file</translation> <translation>Export GMF file</translation>
</message> </message>
<message>
<source>TOP_IMPORT_SAUV</source>
<translation>Import SAUV file</translation>
</message>
<message>
<source>TOP_SAUV</source>
<translation>Export SAUV file</translation>
</message>
<message> <message>
<source>TOP_MERGE</source> <source>TOP_MERGE</source>
<translation>Merge nodes</translation> <translation>Merge nodes</translation>

View File

@ -11,10 +11,6 @@
<source>MED_FILES_FILTER</source> <source>MED_FILES_FILTER</source>
<translation>Fichiers MED</translation> <translation>Fichiers MED</translation>
</message> </message>
<message>
<source>SAUV_FILES_FILTER</source>
<translation>Fichiers SAUV</translation>
</message>
<message> <message>
<source>IDEAS_FILES_FILTER</source> <source>IDEAS_FILES_FILTER</source>
<translation>Fichiers IDEAS</translation> <translation>Fichiers IDEAS</translation>
@ -648,10 +644,6 @@
<source>MEN_EXPORT_GMF</source> <source>MEN_EXPORT_GMF</source>
<translation>Exporter au format GMF</translation> <translation>Exporter au format GMF</translation>
</message> </message>
<message>
<source>MEN_EXPORT_SAUV</source>
<translation>Exporter au format SAUV (ASCII)</translation>
</message>
<message> <message>
<source>MEN_EXPORT_STL</source> <source>MEN_EXPORT_STL</source>
<translation>Exporter au format STL</translation> <translation>Exporter au format STL</translation>
@ -876,14 +868,6 @@
<source>MEN_GMF</source> <source>MEN_GMF</source>
<translation>Fichier GMF</translation> <translation>Fichier GMF</translation>
</message> </message>
<message>
<source>MEN_IMPORT_SAUV</source>
<translation>Fichier SAUV (ASCII)</translation>
</message>
<message>
<source>MEN_SAUV</source>
<translation>Fichier SAUV (ASCII)</translation>
</message>
<message> <message>
<source>MEN_MERGE</source> <source>MEN_MERGE</source>
<translation>Fusionner les nœuds</translation> <translation>Fusionner les nœuds</translation>
@ -3451,10 +3435,6 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
<source>STB_EXPORT_GMF</source> <source>STB_EXPORT_GMF</source>
<translation>Exporter au format GMF</translation> <translation>Exporter au format GMF</translation>
</message> </message>
<message>
<source>STB_EXPORT_SAUV</source>
<translation>Exporter au format SAUV (ASCII)</translation>
</message>
<message> <message>
<source>STB_EXPORT_STL</source> <source>STB_EXPORT_STL</source>
<translation>Exporter au format STL</translation> <translation>Exporter au format STL</translation>
@ -3587,14 +3567,6 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
<source>STB_GMF</source> <source>STB_GMF</source>
<translation>Exporter un fichier GMF</translation> <translation>Exporter un fichier GMF</translation>
</message> </message>
<message>
<source>STB_IMPORT_SAUV</source>
<translation>Importer un fichier SAUV (ASCII)</translation>
</message>
<message>
<source>STB_SAUV</source>
<translation>Exporter un fichier SAUV (ASCII)</translation>
</message>
<message> <message>
<source>STB_MERGE</source> <source>STB_MERGE</source>
<translation>Fusionner les nœuds</translation> <translation>Fusionner les nœuds</translation>
@ -4151,10 +4123,6 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
<source>TOP_EXPORT_MED</source> <source>TOP_EXPORT_MED</source>
<translation>Exporter au format MED</translation> <translation>Exporter au format MED</translation>
</message> </message>
<message>
<source>TOP_EXPORT_SAUV</source>
<translation>Exporter au format SAUV (ASCII)</translation>
</message>
<message> <message>
<source>TOP_EXPORT_STL</source> <source>TOP_EXPORT_STL</source>
<translation>Exporter au format STL</translation> <translation>Exporter au format STL</translation>
@ -4287,14 +4255,6 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
<source>TOP_GMF</source> <source>TOP_GMF</source>
<translation>Exporter un fichier GMF</translation> <translation>Exporter un fichier GMF</translation>
</message> </message>
<message>
<source>TOP_IMPORT_SAUV</source>
<translation>Importer un fichier SAUV (ASCII)</translation>
</message>
<message>
<source>TOP_SAUV</source>
<translation>Exporter un fichier SAUV (ASCII)</translation>
</message>
<message> <message>
<source>TOP_MERGE</source> <source>TOP_MERGE</source>
<translation>Fusionner les nœuds</translation> <translation>Fusionner les nœuds</translation>

View File

@ -11,10 +11,6 @@
<source>MED_FILES_FILTER</source> <source>MED_FILES_FILTER</source>
<translation>MEDファイル</translation> <translation>MEDファイル</translation>
</message> </message>
<message>
<source>SAUV_FILES_FILTER</source>
<translation>SAUVファイル</translation>
</message>
<message> <message>
<source>IDEAS_FILES_FILTER</source> <source>IDEAS_FILES_FILTER</source>
<translation>IDEAS </translation> <translation>IDEAS </translation>
@ -503,10 +499,6 @@
<source>MEN_EXPORT_GMF</source> <source>MEN_EXPORT_GMF</source>
<translation>GMF形式でエクスポート</translation> <translation>GMF形式でエクスポート</translation>
</message> </message>
<message>
<source>MEN_EXPORT_SAUV</source>
<translation>SAUV (ASCII) </translation>
</message>
<message> <message>
<source>MEN_EXPORT_STL</source> <source>MEN_EXPORT_STL</source>
<translation>STL形式でエクスポート</translation> <translation>STL形式でエクスポート</translation>
@ -727,14 +719,6 @@
<source>MEN_GMF</source> <source>MEN_GMF</source>
<translation>GMFファイル</translation> <translation>GMFファイル</translation>
</message> </message>
<message>
<source>MEN_IMPORT_SAUV</source>
<translation>SAUVファイル</translation>
</message>
<message>
<source>MEN_SAUV</source>
<translation>SAUVファイル</translation>
</message>
<message> <message>
<source>MEN_MERGE</source> <source>MEN_MERGE</source>
<translation></translation> <translation></translation>
@ -3147,10 +3131,6 @@
<source>STB_EXPORT_GMF</source> <source>STB_EXPORT_GMF</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>STB_EXPORT_SAUV</source>
<translation>SAUV (ASCII) </translation>
</message>
<message> <message>
<source>STB_EXPORT_STL</source> <source>STB_EXPORT_STL</source>
<translation>STL形式でエクスポート</translation> <translation>STL形式でエクスポート</translation>
@ -3279,14 +3259,6 @@
<source>STB_GMF</source> <source>STB_GMF</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>STB_IMPORT_SAUV</source>
<translation> (ASCII) </translation>
</message>
<message>
<source>STB_SAUV</source>
<translation> (ASCII) </translation>
</message>
<message> <message>
<source>STB_MERGE</source> <source>STB_MERGE</source>
<translation></translation> <translation></translation>
@ -3827,10 +3799,6 @@
<source>TOP_EXPORT_MED</source> <source>TOP_EXPORT_MED</source>
<translation>MED形式でエクスポート</translation> <translation>MED形式でエクスポート</translation>
</message> </message>
<message>
<source>TOP_EXPORT_SAUV</source>
<translation>SAUV (ASCII) </translation>
</message>
<message> <message>
<source>TOP_EXPORT_STL</source> <source>TOP_EXPORT_STL</source>
<translation>STL形式でエクスポート</translation> <translation>STL形式でエクスポート</translation>
@ -3959,14 +3927,6 @@
<source>TOP_GMF</source> <source>TOP_GMF</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>TOP_IMPORT_SAUV</source>
<translation> (ASCII) </translation>
</message>
<message>
<source>TOP_SAUV</source>
<translation> (ASCII) </translation>
</message>
<message> <message>
<source>TOP_MERGE</source> <source>TOP_MERGE</source>
<translation></translation> <translation></translation>

View File

@ -1024,7 +1024,6 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
return; return;
} }
if ( method == "CreateMeshesFromMED" || if ( method == "CreateMeshesFromMED" ||
method == "CreateMeshesFromSAUV"||
method == "CreateMeshesFromCGNS" || method == "CreateMeshesFromCGNS" ||
method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status ) method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status )
{ {
@ -2194,7 +2193,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
static TStringSet sameMethods; static TStringSet sameMethods;
if ( sameMethods.empty() ) { if ( sameMethods.empty() ) {
const char * names[] = const char * names[] =
{ "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents", { "ExportDAT","ExportUNV","ExportSTL", "RemoveGroup","RemoveGroupWithContents",
"GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId", "GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId",
"ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements", "ClearLog","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements",
"NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles", "NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles",

View File

@ -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::mesh_array* SMESH_Gen_i::CreateMeshesFromMED( const char* theFileName,
SMESH::DriverMED_ReadStatus& theStatus, SMESH::DriverMED_ReadStatus& theStatus )
const char* theCommandNameForPython,
const char* theFileNameForPython)
{ {
checkFileReadable( theFileName );
#ifdef WIN32 #ifdef WIN32
char bname[ _MAX_FNAME ]; char bname[ _MAX_FNAME ];
_splitpath( theFileNameForPython, NULL, NULL, bname, NULL ); _splitpath( theFileName, NULL, NULL, bname, NULL );
string aFileName = bname; string aFileName = bname;
#else #else
string aFileName = basename( const_cast<char *>(theFileNameForPython) ); string aFileName = basename( const_cast<char *>( theFileName ));
#endif #endif
// Retrieve mesh names from the file // Retrieve mesh names from the file
DriverMED_R_SMESHDS_Mesh myReader; 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() { // open a new scope to make aPythonDump die before PythonDump in SMESH_Mesh::GetGroups()
// Python Dump // Python Dump
TPythonDump aPythonDump(this); TPythonDump aPythonDump(this);
aPythonDump << "(["; aPythonDump << "([";
if (theStatus == SMESH::DRS_OK) { 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;
// Iterate through all meshes and create mesh objects
for ( list<string>::iterator it = aNames.begin(); it != aNames.end(); it++ )
{ {
// Python Dump SALOMEDS::StudyBuilder_var aStudyBuilder;
if (i > 0) aPythonDump << ", "; aStudyBuilder = getStudyServant()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
// create mesh aResult->length( aNames.size() );
SMESH::SMESH_Mesh_var mesh = createMesh(); int i = 0;
// publish mesh in the study // Iterate through all meshes and create mesh objects
SALOMEDS::SObject_wrap aSO; for ( const std::string & meshName : aNames )
if ( CanPublishInStudy( mesh ) ) {
// little trick: for MED file theFileName and theFileNameForPython are the same, but they are different for SAUV // Python Dump
// - as names of meshes are stored in MED file, we use them for data publishing if (i > 0) aPythonDump << ", ";
// - 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 // create mesh
if ( !aSO->_is_nil() ) { SMESH::SMESH_Mesh_var mesh = createMesh();
aPythonDump << aSO;
} else { // publish mesh in the study
aPythonDump << "mesh_" << i; 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<SMESH_Mesh_i*>( 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();
} }
if ( !aStudyBuilder->_is_nil() )
// Read mesh data (groups are published automatically by ImportMEDFile()) aStudyBuilder->CommitCommand();
SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( mesh ).in() );
ASSERT( meshServant );
SMESH::DriverMED_ReadStatus status1 =
meshServant->ImportMEDFile( theFileName, (*it).c_str() );
if (status1 > theStatus)
theStatus = status1;
aResult[i++] = SMESH::SMESH_Mesh::_duplicate( mesh );
meshServant->GetImpl().GetMeshDS()->Modified();
} }
if ( !aStudyBuilder->_is_nil() )
aStudyBuilder->CommitCommand();
}
// Update Python script // Update Python script
aPythonDump << "], status) = " << this << "." << theCommandNameForPython << "(r'" << theFileNameForPython << "')"; aPythonDump << "], status) = " << this << ".CreateMeshesFromMED( r'" << theFileName << "' )";
} }
// Dump creation of groups // Dump creation of groups
for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) 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(); 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 * SMESH_Gen_i::CreateMeshFromSTL

View File

@ -241,10 +241,6 @@ public:
SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName, SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
SMESH::DriverMED_ReadStatus& theStatus ); 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 // Create a mesh and import data from a STL file
SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName ); SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName );
@ -641,11 +637,6 @@ private:
void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid ); 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<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart, std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
SMESH::ElementType ElemType, SMESH::ElementType ElemType,
const TopoDS_Shape& Shape, const TopoDS_Shape& Shape,

View File

@ -3797,27 +3797,6 @@ CORBA::LongLong SMESH_Mesh_i::ExportMEDCoupling(CORBA::Boolean auto_groups, CORB
return reinterpret_cast<CORBA::LongLong>(ret); return reinterpret_cast<CORBA::LongLong>(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 * \brief Export a mesh to a DAT file

View File

@ -215,8 +215,6 @@ public:
CORBA::LongLong ExportMEDCoupling(CORBA::Boolean auto_groups, CORBA::LongLong ExportMEDCoupling(CORBA::Boolean auto_groups,
CORBA::Boolean autoDimension = true); CORBA::Boolean autoDimension = true);
void ExportSAUV( const char* file, CORBA::Boolean auto_groups );
void ExportDAT( const char* file, const CORBA::Boolean renumber ); void ExportDAT( const char* file, const CORBA::Boolean renumber );
void ExportUNV( const char* file, const CORBA::Boolean renumber ); void ExportUNV( const char* file, const CORBA::Boolean renumber );
void ExportSTL( const char* file, bool isascii ); void ExportSTL( const char* file, bool isascii );