X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Gen.cxx;h=01d864c6f3747157c2a7e939eb07c647f6642727;hb=bbdbca270f2d1247d7a49c8500108099b9369ec6;hp=3a202a347c95489c75473a369f0f0be2b6b92378;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 3a202a347..01d864c6f 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -208,12 +208,21 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) // mesh the rest subshapes starting from vertices // ----------------------------------------------- - smToCompute = sm->GetFirstToCompute(); - while (smToCompute) + int i, nbSub = smMap.size(); + map::const_iterator itSub = smMap.begin(); + for ( i = 0; i <= nbSub; ++i ) // loop on the whole map plus { + if ( itSub == smMap.end() ) + smToCompute = sm; + else + smToCompute = (itSub++)->second; + if (smToCompute->GetComputeState() != SMESH_subMesh::READY_TO_COMPUTE) { + if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) + ret = false; + continue; + } TopoDS_Shape subShape = smToCompute->GetSubShape(); - int dim = GetShapeDim(subShape); - if (dim > 0) + if ( subShape.ShapeType() != TopAbs_VERTEX ) { if ( !smToCompute->ComputeStateEngine(SMESH_subMesh::COMPUTE) ) ret = false; @@ -229,22 +238,10 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) smToCompute->ComputeStateEngine(SMESH_subMesh::COMPUTE); } } - smToCompute = sm->GetFirstToCompute(); } - if (!ret) return false; - - // JFA for PAL6524: if there are failed sub-meshes, return Standard_False - const map < int, SMESH_subMesh * >&subMeshes = sm->DependsOn(); - map < int, SMESH_subMesh * >::const_iterator itsub; - for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++) { - SMESH_subMesh *smi = (*itsub).second; - if (smi->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) return false; - } - if (sm->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE) return false; - - MESSAGE( "VSR - SMESH_Gen::Compute() finished" ); - return true; + MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret); + return ret; }