+ // get progress of a current algo
+ TColStd_MapOfInteger currentSubIds;
+ if ( curSM )
+ if ( SMESH_Algo* algo = curSM->GetAlgo() )
+ {
+ int algoNotDoneCost = 0, algoDoneCost = 0;
+ const std::vector<SMESH_subMesh*>& smToCompute = algo->SubMeshesToCompute();
+ for ( size_t i = 0; i < smToCompute.size(); ++i )
+ {
+ if ( smToCompute[i]->IsEmpty() )
+ algoNotDoneCost += smToCompute[i]->GetComputeCost();
+ else
+ algoDoneCost += smToCompute[i]->GetComputeCost();
+ currentSubIds.Add( smToCompute[i]->GetId() );
+ }
+ double rate = algo->GetProgress();
+ if ( !( 0. < rate && rate < 1.001 ))
+ {
+ rate = algo->GetProgressByTic();
+ }
+ // cout << "rate: "<<rate << " algoNotDoneCost: " << algoNotDoneCost << endl;
+ computedCost += algoDoneCost + rate * algoNotDoneCost;
+ }
+