Salome HOME
Merge from V7_main
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index bcddd46d52d707b398cf7b48fa5eaee7da38a1de..a8a789fbd070853499d55692d9c481ab77fa0960 100644 (file)
@@ -66,6 +66,8 @@
 #include <TopTools_MapOfShape.hxx>
 #include <TopoDS_Iterator.hxx>
 
+#include "SMESH_TryCatch.hxx" // include after OCCT headers!
+
 #include "Utils_ExceptHandlers.hxx"
 
 #include <boost/thread/thread.hpp>
@@ -1259,7 +1261,7 @@ void SMESH_Mesh::ExportMED(const char *        file,
                            bool                theAutoDimension)
   throw(SALOME_Exception)
 {
-  Unexpect aCatch(SalomeException);
+  SMESH_TRY;
 
   DriverMED_W_SMESHDS_Mesh myWriter;
   myWriter.SetFile         ( file, MED::EVersion(theVersion) );
@@ -1306,6 +1308,8 @@ void SMESH_Mesh::ExportMED(const char *        file,
   }
   // Perform export
   myWriter.Perform();
+
+  SMESH_CATCH( SMESH::throwSalomeEx );
 }
 
 //================================================================================
@@ -1486,12 +1490,16 @@ double SMESH_Mesh::GetComputeProgress() const
         currentSubIds.Add( smToCompute[i]->GetId() );
       }
       double rate = algo->GetProgress();
-      if ( !( 0. < rate && rate < 1.001 ))
+      if ( 0. < rate && rate < 1.001 )
+      {
+        computedCost += rate * ( algoDoneCost + algoNotDoneCost );
+      }
+      else
       {
         rate = algo->GetProgressByTic();
+        computedCost += algoDoneCost + rate * algoNotDoneCost;
       }
       // cout << "rate: "<<rate << " algoNotDoneCost: " << algoNotDoneCost << endl;
-      computedCost += algoDoneCost + rate * algoNotDoneCost;
     }
 
   // get cost of already treated sub-meshes