mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
Issue 0020520: [CEA 358] Import - Export Sauv files in SMESH
This commit is contained in:
parent
75e6081e5e
commit
f6c3a1e96c
@ -174,6 +174,10 @@
|
||||
else if ( theCommandID == 111 ) {
|
||||
filter.append( QObject::tr( "DAT files (*.dat)" ) );
|
||||
}
|
||||
else if ( theCommandID == 115 ) {
|
||||
filter.append( QObject::tr( "SAUV files (*.sauv *.sauve)" ) );
|
||||
filter.append( QObject::tr( "All files (*)" ) );
|
||||
}
|
||||
|
||||
QString anInitialPath = "";
|
||||
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
||||
@ -287,6 +291,8 @@
|
||||
switch ( theCommandID ) {
|
||||
case 125:
|
||||
case 122:
|
||||
case 142:
|
||||
case 143:
|
||||
{
|
||||
if (aMesh->HasDuplicatedGroupNamesMED()) {
|
||||
int aRet = SUIT_MessageBox::warning
|
||||
@ -297,6 +303,10 @@
|
||||
if (aRet != SUIT_MessageBox::Yes)
|
||||
return;
|
||||
}
|
||||
switch ( theCommandID ) {
|
||||
case 125:
|
||||
case 122:
|
||||
{
|
||||
// PAL18696
|
||||
QString v21 (aMesh->GetVersionString(SMESH::MED_V2_1, 2));
|
||||
QString v22 (aMesh->GetVersionString(SMESH::MED_V2_2, 2));
|
||||
@ -304,6 +314,16 @@
|
||||
aFilterMap.insert( QString("MED ") + v22 + " (*.med)", SMESH::MED_V2_2 );
|
||||
}
|
||||
break;
|
||||
case 142:
|
||||
case 143:
|
||||
{
|
||||
aFilterMap.insert("SAUV files (*.sauv *.sauve)", SMESH::MED_V2_2 );
|
||||
aFilterMap.insert("All files (*)", SMESH::MED_V2_1 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 124:
|
||||
case 121:
|
||||
aFilter = QObject::tr("DAT files (*.dat)");
|
||||
@ -368,7 +388,7 @@
|
||||
if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
|
||||
anInitialPath = QDir::currentPath();
|
||||
|
||||
if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 140 && theCommandID != 141) {
|
||||
if ( theCommandID != 122 && theCommandID != 125 && theCommandID != 140 && theCommandID != 141 && theCommandID != 142 && theCommandID != 143) {
|
||||
if ( anInitialPath.isEmpty() ) anInitialPath = SUIT_FileDlg::getLastVisitedPath();
|
||||
aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), anInitialPath + QString("/") + anIObject->getName(),
|
||||
aFilter, aTitle, false);
|
||||
@ -461,6 +481,26 @@
|
||||
case 122:
|
||||
aMesh->ExportToMED( aFilename.toLatin1().data(), toCreateGroups, aFormat );
|
||||
break;
|
||||
case 142:
|
||||
case 143:
|
||||
{
|
||||
std::string file_out = aFilename.toLatin1().data();
|
||||
std::string file_tmp = file_out + "_tmp.med";
|
||||
std::string cmd;
|
||||
aMesh->ExportToMED( file_tmp.c_str(), toCreateGroups, aFormat );
|
||||
#ifdef WNT
|
||||
cmd = "%PYTHONBIN% ";
|
||||
#else
|
||||
cmd = "python ";
|
||||
#endif
|
||||
cmd += "-c \"";
|
||||
cmd += "from medutilities import convert ; convert(r'" + file_tmp + "', 'MED', 'GIBI', 1, r'" + file_out + "')";
|
||||
cmd += " ; ";
|
||||
cmd += "from medutilities import my_remove ; my_remove(r'" + file_tmp + "')";
|
||||
cmd += "\"";
|
||||
system(cmd.c_str());
|
||||
}
|
||||
break;
|
||||
case 124:
|
||||
case 121:
|
||||
aMesh->ExportDAT( aFilename.toLatin1().data() );
|
||||
@ -1384,6 +1424,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
case 113: // IMPORT
|
||||
case 112:
|
||||
case 111:
|
||||
case 115:
|
||||
{
|
||||
if(checkLock(aStudy)) break;
|
||||
::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
|
||||
@ -1417,6 +1458,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
case 126:
|
||||
case 140:
|
||||
case 141:
|
||||
case 142:
|
||||
case 143:
|
||||
{
|
||||
::ExportMeshToFile(theCommandID);
|
||||
break;
|
||||
@ -2696,15 +2739,18 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
createSMESHAction( 111, "DAT", "", (Qt::CTRL+Qt::Key_B) );
|
||||
createSMESHAction( 112, "UNV", "", (Qt::CTRL+Qt::Key_U) );
|
||||
createSMESHAction( 113, "MED", "", (Qt::CTRL+Qt::Key_M) );
|
||||
createSMESHAction( 115, "SAUV" );
|
||||
createSMESHAction( 114, "NUM" );
|
||||
createSMESHAction( 121, "DAT" );
|
||||
createSMESHAction( 122, "MED" );
|
||||
createSMESHAction( 123, "UNV" );
|
||||
createSMESHAction( 140, "STL" );
|
||||
createSMESHAction( 142, "SAUV" );
|
||||
createSMESHAction( 124, "EXPORT_DAT" );
|
||||
createSMESHAction( 125, "EXPORT_MED" );
|
||||
createSMESHAction( 126, "EXPORT_UNV" );
|
||||
createSMESHAction( 141, "EXPORT_STL" );
|
||||
createSMESHAction( 143, "EXPORT_SAUV" );
|
||||
createSMESHAction( 150, "FILE_INFO" );
|
||||
createSMESHAction( 33, "DELETE", "ICON_DELETE", Qt::Key_Delete );
|
||||
createSMESHAction( 5105, "SEL_FILTER_LIB" );
|
||||
@ -2843,11 +2889,13 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
createMenu( 111, importId, -1 );
|
||||
createMenu( 112, importId, -1 );
|
||||
createMenu( 113, importId, -1 );
|
||||
createMenu( 115, importId, -1 );
|
||||
|
||||
createMenu( 121, exportId, -1 );
|
||||
createMenu( 122, exportId, -1 );
|
||||
createMenu( 123, exportId, -1 );
|
||||
createMenu( 140, exportId, -1 ); // export to stl STL
|
||||
createMenu( 142, exportId, -1 );
|
||||
|
||||
createMenu( separator(), fileId, 10 );
|
||||
|
||||
@ -3122,6 +3170,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
createPopupItem( 125, OB, mesh, only_one_non_empty ); // EXPORT_MED
|
||||
createPopupItem( 126, OB, mesh, only_one_non_empty ); // EXPORT_UNV
|
||||
createPopupItem( 141, OB, mesh, only_one_non_empty ); // EXPORT_STL
|
||||
createPopupItem( 143, OB, mesh, only_one_non_empty ); // EXPORT_SAUV
|
||||
//createPopupItem( 33, OB, subMesh + " " + group ); // DELETE
|
||||
createPopupItem( 33, OB, mesh_group + " " + hyp_alg ); // DELETE
|
||||
popupMgr()->insert( separator(), -1, 0 );
|
||||
|
@ -313,6 +313,10 @@
|
||||
<source>MEN_EXPORT_MED</source>
|
||||
<translation>Export to MED File</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_SAUV</source>
|
||||
<translation>Export to SAUV (ASCII) file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EXPORT_STL</source>
|
||||
<translation>Export to STL File</translation>
|
||||
@ -397,6 +401,10 @@
|
||||
<source>MEN_MED</source>
|
||||
<translation>MED file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_SAUV</source>
|
||||
<translation>SAUV (ASCII) file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_MERGE</source>
|
||||
<translation>Merge Nodes</translation>
|
||||
@ -2143,6 +2151,10 @@ Consider saving your work before application crash</translation>
|
||||
<source>STB_EXPORT_MED</source>
|
||||
<translation>Export to MED file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_SAUV</source>
|
||||
<translation>Export to SAUV (ASCII) file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_EXPORT_STL</source>
|
||||
<translation>Export to STL file</translation>
|
||||
@ -2217,6 +2229,10 @@ Consider saving your work before application crash</translation>
|
||||
<source>STB_MED</source>
|
||||
<translation>Import MED file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_SAUV</source>
|
||||
<translation>Import SAUV (ASCII) file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>STB_MERGE</source>
|
||||
<translation>Merge nodes</translation>
|
||||
@ -2641,6 +2657,10 @@ Consider saving your work before application crash</translation>
|
||||
<source>TOP_EXPORT_MED</source>
|
||||
<translation>Export to MED file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_SAUV</source>
|
||||
<translation>Export to SAUV (ASCII) file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_EXPORT_STL</source>
|
||||
<translation>Export to STL file</translation>
|
||||
@ -2715,6 +2735,10 @@ Consider saving your work before application crash</translation>
|
||||
<source>TOP_MED</source>
|
||||
<translation>Import MED file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_SAUV</source>
|
||||
<translation>Import SAUV (ASCII) file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOP_MERGE</source>
|
||||
<translation>Merge nodes</translation>
|
||||
|
Loading…
Reference in New Issue
Block a user