mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-26 12:00:33 +05:00
Compute Progress bar: ignore sub-meshes that are NOT_READY to compute
This commit is contained in:
parent
8ead976689
commit
e0f019ccf9
@ -1476,13 +1476,16 @@ double SMESH_Mesh::GetComputeProgress() const
|
|||||||
while ( smIt->more() )
|
while ( smIt->more() )
|
||||||
{
|
{
|
||||||
SMESH_subMesh* sm = smIt->next();
|
SMESH_subMesh* sm = smIt->next();
|
||||||
const int smCost = sm->GetComputeCost();
|
if ( sm->GetComputeState() != SMESH_subMesh::NOT_READY )
|
||||||
totalCost += smCost;
|
|
||||||
if ( sm != curSM &&
|
|
||||||
( !sm->IsEmpty() ||
|
|
||||||
sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE ))
|
|
||||||
{
|
{
|
||||||
computedCost += smCost;
|
const int smCost = sm->GetComputeCost();
|
||||||
|
totalCost += smCost;
|
||||||
|
if ( sm != curSM &&
|
||||||
|
( !sm->IsEmpty() ||
|
||||||
|
sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE ))
|
||||||
|
{
|
||||||
|
computedCost += smCost;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1496,10 +1499,14 @@ double SMESH_Mesh::GetComputeProgress() const
|
|||||||
//cout << " rate: " << rate << " cost " << algo->GetComputeCost() << endl;
|
//cout << " rate: " << rate << " cost " << algo->GetComputeCost() << endl;
|
||||||
computedCost += rate * algo->GetComputeCost();
|
computedCost += rate * algo->GetComputeCost();
|
||||||
}
|
}
|
||||||
else
|
else if ( curSM->IsEmpty() )
|
||||||
{
|
{
|
||||||
computedCost += algo->GetProgressByTic() * algo->GetComputeCost();
|
computedCost += algo->GetProgressByTic() * algo->GetComputeCost();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
computedCost += 0.99 * algo->GetComputeCost();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//cout << "Total: " << totalCost << " progress: " << computedCost / totalCost << endl;
|
//cout << "Total: " << totalCost << " progress: " << computedCost / totalCost << endl;
|
||||||
return computedCost / totalCost;
|
return computedCost / totalCost;
|
||||||
|
@ -2089,7 +2089,8 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
|
|||||||
{
|
{
|
||||||
const TopoDS_Shape& S = anExplorer.Current();
|
const TopoDS_Shape& S = anExplorer.Current();
|
||||||
SMESH_subMesh* subMesh = _father->GetSubMesh( S );
|
SMESH_subMesh* subMesh = _father->GetSubMesh( S );
|
||||||
theComputeCost += subMesh->GetComputeCost();
|
if ( subMesh->GetComputeState() != NOT_READY )
|
||||||
|
theComputeCost += subMesh->GetComputeCost();
|
||||||
if ( subMesh == this )
|
if ( subMesh == this )
|
||||||
{
|
{
|
||||||
aBuilder.Add( aCompound, S );
|
aBuilder.Add( aCompound, S );
|
||||||
@ -2109,7 +2110,8 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
|
|||||||
while ( smIt->more() )
|
while ( smIt->more() )
|
||||||
{
|
{
|
||||||
SMESH_subMesh* sm = smIt->next();
|
SMESH_subMesh* sm = smIt->next();
|
||||||
if ( sm->IsEmpty() )
|
if ( sm->GetComputeState() != NOT_READY &&
|
||||||
|
sm->IsEmpty() )
|
||||||
theComputeCost += sm->GetComputeCost();
|
theComputeCost += sm->GetComputeCost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user