]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Issue 0020520: [CEA 358] Import - Export Sauv files in SMESH
authorvsr <vsr@opencascade.com>
Wed, 7 Oct 2009 13:32:10 +0000 (13:32 +0000)
committervsr <vsr@opencascade.com>
Wed, 7 Oct 2009 13:32:10 +0000 (13:32 +0000)
src/SMESHGUI/SMESHGUI.cxx

index 356ccec8455a80ad2fb5c164277b2ba5dd3e1ffc..ba1333b8ef4d73f9f863f2a37b95d7ad401132cb 100644 (file)
               }
               break;
             }
+         case 115:
+           {
+             std::string file_in = filename.toLatin1().constData();
+             std::string file_tmp = file_in + ".med";
+             std::string cmd;
+#ifdef WNT
+             cmd = "%PYTHONBIN% ";
+#else
+             cmd = "python ";
+#endif
+             cmd += "-c \"";
+             cmd += "from medutilities import convert ; convert(r'" + file_in + "', 'GIBI', 'MED', 1, r'" + file_tmp + "')";
+             cmd += "\"";
+             system(cmd.c_str());
+             // MED format
+             SMESH::DriverMED_ReadStatus res;
+             aMeshes = theComponentMesh->CreateMeshesFromMED( file_tmp.c_str(), 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() ) ) );
+             }
+#ifdef WNT
+             cmd = "%PYTHONBIN% ";
+#else
+             cmd = "python ";
+#endif
+             cmd += "-c \"";
+             cmd += "from medutilities import my_remove ; my_remove(r'" + file_tmp + "')";
+             cmd += "\"";
+             system(cmd.c_str());
+             break;
+           }
           }
         }
         catch ( const SALOME::SALOME_Exception& S_ex ) {
@@ -2693,7 +2725,7 @@ void SMESHGUI::createPopupItem( const int id,
                                 const QString& clients,
                                 const QString& types,
                                 const QString& theRule,
-                               const int pId )
+                                const int pId )
 {
   int parentId = pId;
   if( pId!=-1 )