X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Algo.cxx;h=263a1e673fe1779932eaff6e1e1b68121154d308;hb=3f3beb8b958607b3ac214b8234b5ae5d99facc13;hp=79a77f8276b9a14ea9963f62ecfab9315c01a1e5;hpb=fad96c28703b39afa8a98eb004a4d8921f8eb9ec;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 79a77f827..263a1e673 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -754,7 +754,6 @@ void SMESH_Algo::InitComputeError() _badInputElements.clear(); _computeCanceled = false; - _computeCost = 1; _progressTic = 0; _progress = 0.; } @@ -767,9 +766,14 @@ void SMESH_Algo::InitComputeError() double SMESH_Algo::GetProgressByTic() const { + int computeCost = 0; + for ( size_t i = 0; i < _smToCompute.size(); ++i ) + computeCost += _smToCompute[i]->GetComputeCost(); + const_cast( this )->_progressTic++; + double x = 5 * _progressTic; - x = ( x < _computeCost ) ? ( x / _computeCost ) : 1.; + x = ( x < computeCost ) ? ( x / computeCost ) : 1.; return 0.9 * sin( x * M_PI / 2 ); }