while ( smIt->more() )
{
SMESH_subMesh* sm = smIt->next();
- const int smCost = sm->GetComputeCost();
- totalCost += smCost;
- if ( sm != curSM &&
- ( !sm->IsEmpty() ||
- sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE ))
+ if ( sm->GetComputeState() != SMESH_subMesh::NOT_READY )
{
- computedCost += smCost;
+ const int smCost = sm->GetComputeCost();
+ totalCost += smCost;
+ if ( sm != curSM &&
+ ( !sm->IsEmpty() ||
+ sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE ))
+ {
+ computedCost += smCost;
+ }
}
}
}
//cout << " rate: " << rate << " cost " << algo->GetComputeCost() << endl;
computedCost += rate * algo->GetComputeCost();
}
- else
+ else if ( curSM->IsEmpty() )
{
computedCost += algo->GetProgressByTic() * algo->GetComputeCost();
}
+ else
+ {
+ computedCost += 0.99 * algo->GetComputeCost();
+ }
}
//cout << "Total: " << totalCost << " progress: " << computedCost / totalCost << endl;
return computedCost / totalCost;
{
const TopoDS_Shape& S = anExplorer.Current();
SMESH_subMesh* subMesh = _father->GetSubMesh( S );
- theComputeCost += subMesh->GetComputeCost();
+ if ( subMesh->GetComputeState() != NOT_READY )
+ theComputeCost += subMesh->GetComputeCost();
if ( subMesh == this )
{
aBuilder.Add( aCompound, S );
while ( smIt->more() )
{
SMESH_subMesh* sm = smIt->next();
- if ( sm->IsEmpty() )
+ if ( sm->GetComputeState() != NOT_READY &&
+ sm->IsEmpty() )
theComputeCost += sm->GetComputeCost();
}
}