* 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.
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**,
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:
smeshBuilder.CreateMeshesFromSTL
smeshBuilder.CreateMeshesFromCGNS
smeshBuilder.CreateMeshesFromGMF
- smeshBuilder.CreateMeshesFromSAUV
Mesh.ExportMED
Mesh.ExportUNV
Mesh.ExportSTL
Mesh.ExportCGNS
Mesh.ExportDAT
- Mesh.ExportSAUV
Mesh.ExportGMF
/*!
* 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
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)
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
{
void AddGroupOfVolumes();
void AddGroupOf0DElems();
void AddGroupOfBalls();
- void AddAllToGroup();
/*! functions to prepare adding one mesh
*/
bool theAutoDimension,
bool theAddODOnVertices,
double theZTolerance,
- bool theSaveNumbers,
- bool theAllElemsToGroup)
+ bool theSaveNumbers)
{
Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
theWriter.AddGroupOf0DElems();
theWriter.AddGroupOfBalls();
}
- if ( theAllElemsToGroup )
- theWriter.AddAllToGroup();
// Pass groups to writer. Provide unique group names.
//set<string> aGroupNames; // Corrected for Mantis issue 0020028
{
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();
}
* 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
*/
//================================================================================
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 );
}
//================================================================================
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,
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;
bool theAutoDimension,
bool theAddODOnVertices,
double theZTolerance,
- bool theSaveNumbers,
- bool theAllElemsToGroup);
+ bool theSaveNumbers);
private:
void fillAncestorsMap(const TopoDS_Shape& theShape);
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)" );
}
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:
{
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 );
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++ ) {
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";
}
delete fd;
}
- else if ( isMED || isSAUV ) // Export to MED or SAUV
+ else if ( isMED ) // Export to MED
{
int defaultVersion = 0;
QMap<QString, int> 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<QString, int>::const_iterator it = aFilterMap.begin();
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 ))
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;
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);
#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");
#ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpPopupImportCGNS, "IMPORT_CGNS" );
#endif
- createSMESHAction( SMESHOp::OpPopupImportSAUV, "IMPORT_SAUV" );
createSMESHAction( SMESHOp::OpPopupImportGMF, "IMPORT_GMF" );
createSMESHAction( SMESHOp::OpExportDAT, "DAT" );
#ifdef WITH_CGNS
createSMESHAction( SMESHOp::OpExportCGNS, "CGNS");
#endif
- createSMESHAction( SMESHOp::OpExportSAUV, "SAUV");
createSMESHAction( SMESHOp::OpExportGMF, "GMF" );
createSMESHAction( SMESHOp::OpPopupExportDAT, "DAT" );
createSMESHAction( SMESHOp::OpPopupExportMED, "MED" );
#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 );
#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 );
#ifdef WITH_CGNS
createMenu( SMESHOp::OpExportCGNS, exportId, -1 );
#endif
- createMenu( SMESHOp::OpExportSAUV, exportId, -1 );
createMenu( SMESHOp::OpExportGMF, exportId, -1 );
createMenu( separator(), fileId, 10 );
#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 );
#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 );
<< 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();
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
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
<source>MED_FILES_FILTER</source>
<translation>MED files</translation>
</message>
- <message>
- <source>SAUV_FILES_FILTER</source>
- <translation>SAUV files</translation>
- </message>
<message>
<source>IDEAS_FILES_FILTER</source>
<translation>IDEAS files</translation>
<source>MEN_EXPORT_GMF</source>
<translation>Export to GMF file</translation>
</message>
- <message>
- <source>MEN_EXPORT_SAUV</source>
- <translation>Export to SAUV file</translation>
- </message>
<message>
<source>MEN_EXPORT_STL</source>
<translation>Export to STL file</translation>
<source>MEN_GMF</source>
<translation>GMF file</translation>
</message>
- <message>
- <source>MEN_IMPORT_SAUV</source>
- <translation>SAUV file</translation>
- </message>
- <message>
- <source>MEN_SAUV</source>
- <translation>SAUV file</translation>
- </message>
<message>
<source>MEN_MERGE</source>
<translation>Merge Nodes</translation>
<source>STB_EXPORT_GMF</source>
<translation>Export to GMF file</translation>
</message>
- <message>
- <source>STB_EXPORT_SAUV</source>
- <translation>Export to SAUV file</translation>
- </message>
<message>
<source>STB_EXPORT_STL</source>
<translation>Export to STL file</translation>
<source>STB_GMF</source>
<translation>Export GMF file</translation>
</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>
<source>STB_MERGE</source>
<translation>Merge nodes</translation>
<source>TOP_EXPORT_MED</source>
<translation>Export to MED file</translation>
</message>
- <message>
- <source>TOP_EXPORT_SAUV</source>
- <translation>Export to SAUV file</translation>
- </message>
<message>
<source>TOP_EXPORT_STL</source>
<translation>Export to STL file</translation>
<source>TOP_GMF</source>
<translation>Export GMF file</translation>
</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>
<source>TOP_MERGE</source>
<translation>Merge nodes</translation>
<source>MED_FILES_FILTER</source>
<translation>Fichiers MED</translation>
</message>
- <message>
- <source>SAUV_FILES_FILTER</source>
- <translation>Fichiers SAUV</translation>
- </message>
<message>
<source>IDEAS_FILES_FILTER</source>
<translation>Fichiers IDEAS</translation>
<source>MEN_EXPORT_GMF</source>
<translation>Exporter au format GMF</translation>
</message>
- <message>
- <source>MEN_EXPORT_SAUV</source>
- <translation>Exporter au format SAUV (ASCII)</translation>
- </message>
<message>
<source>MEN_EXPORT_STL</source>
<translation>Exporter au format STL</translation>
<source>MEN_GMF</source>
<translation>Fichier GMF</translation>
</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>
<source>MEN_MERGE</source>
<translation>Fusionner les nœuds</translation>
<source>STB_EXPORT_GMF</source>
<translation>Exporter au format GMF</translation>
</message>
- <message>
- <source>STB_EXPORT_SAUV</source>
- <translation>Exporter au format SAUV (ASCII)</translation>
- </message>
<message>
<source>STB_EXPORT_STL</source>
<translation>Exporter au format STL</translation>
<source>STB_GMF</source>
<translation>Exporter un fichier GMF</translation>
</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>
<source>STB_MERGE</source>
<translation>Fusionner les nœuds</translation>
<source>TOP_EXPORT_MED</source>
<translation>Exporter au format MED</translation>
</message>
- <message>
- <source>TOP_EXPORT_SAUV</source>
- <translation>Exporter au format SAUV (ASCII)</translation>
- </message>
<message>
<source>TOP_EXPORT_STL</source>
<translation>Exporter au format STL</translation>
<source>TOP_GMF</source>
<translation>Exporter un fichier GMF</translation>
</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>
<source>TOP_MERGE</source>
<translation>Fusionner les nœuds</translation>
<source>MED_FILES_FILTER</source>
<translation>MEDファイル</translation>
</message>
- <message>
- <source>SAUV_FILES_FILTER</source>
- <translation>SAUVファイル</translation>
- </message>
<message>
<source>IDEAS_FILES_FILTER</source>
<translation>IDEAS ファイル</translation>
<source>MEN_EXPORT_GMF</source>
<translation>GMF形式でエクスポート</translation>
</message>
- <message>
- <source>MEN_EXPORT_SAUV</source>
- <translation>SAUV (ASCII) 形式でエクスポート</translation>
- </message>
<message>
<source>MEN_EXPORT_STL</source>
<translation>STL形式でエクスポート</translation>
<source>MEN_GMF</source>
<translation>GMFファイル</translation>
</message>
- <message>
- <source>MEN_IMPORT_SAUV</source>
- <translation>SAUVファイル</translation>
- </message>
- <message>
- <source>MEN_SAUV</source>
- <translation>SAUVファイル</translation>
- </message>
<message>
<source>MEN_MERGE</source>
<translation>節点の結合</translation>
<source>STB_EXPORT_GMF</source>
<translation>組み換えをエクスポートします。</translation>
</message>
- <message>
- <source>STB_EXPORT_SAUV</source>
- <translation>SAUV (ASCII) 形式でエクスポート</translation>
- </message>
<message>
<source>STB_EXPORT_STL</source>
<translation>STL形式でエクスポート</translation>
<source>STB_GMF</source>
<translation>組み換えファイルをエクスポートします。</translation>
</message>
- <message>
- <source>STB_IMPORT_SAUV</source>
- <translation>バックアップ (ASCII) ファイルをインポートします。</translation>
- </message>
- <message>
- <source>STB_SAUV</source>
- <translation>バックアップ (ASCII) ファイルをエクスポートします。</translation>
- </message>
<message>
<source>STB_MERGE</source>
<translation>ノードを結合します。</translation>
<source>TOP_EXPORT_MED</source>
<translation>MED形式でエクスポート</translation>
</message>
- <message>
- <source>TOP_EXPORT_SAUV</source>
- <translation>SAUV (ASCII) 形式でエクスポート</translation>
- </message>
<message>
<source>TOP_EXPORT_STL</source>
<translation>STL形式でエクスポート</translation>
<source>TOP_GMF</source>
<translation>組み換えファイルをエクスポートします。</translation>
</message>
- <message>
- <source>TOP_IMPORT_SAUV</source>
- <translation>バックアップ (ASCII) ファイルをインポートします。</translation>
- </message>
- <message>
- <source>TOP_SAUV</source>
- <translation>バックアップ (ASCII) ファイルをエクスポートします。</translation>
- </message>
<message>
<source>TOP_MERGE</source>
<translation>ノードを結合します。</translation>
return;
}
if ( method == "CreateMeshesFromMED" ||
- method == "CreateMeshesFromSAUV"||
method == "CreateMeshesFromCGNS" ||
method == "CreateMeshesFromGMF" ) // command result is ( [mesh1,mesh2], status )
{
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",
*/
//=============================================================================
-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<char *>(theFileNameForPython) );
+ string aFileName = basename( const_cast<char *>( theFileName ));
#endif
// Retrieve mesh names from the file
DriverMED_R_SMESHDS_Mesh myReader;
{ // 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<string>::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<SMESH_Mesh_i*>( 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<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();
+ 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 )
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::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 );
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,
SMESH::ElementType ElemType,
const TopoDS_Shape& Shape,
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
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 );
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
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