From: eap Date: Fri, 7 Sep 2012 07:58:38 +0000 (+0000) Subject: 0021843: [CEA 658] Segmentation fault when using GHS3D on a 2D group X-Git-Tag: V6_6_0a1~130 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8658faa90201a4e88a52279b6faf0d435917b6e;p=modules%2Fsmesh.git 0021843: [CEA 658] Segmentation fault when using GHS3D on a 2D group Avoid "1D global algo is missing" error if it's not really missing --- diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index df6424696..d68dce5af 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -646,7 +646,8 @@ static bool checkMissing(SMESH_Gen* aGen, set& aCheckedMap, list< SMESH_Gen::TAlgoStateError > & theErrors) { - if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX) + if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX || + aCheckedMap.count( aSubMesh )) return true; //MESSAGE("=====checkMissing"); @@ -702,8 +703,15 @@ static bool checkMissing(SMESH_Gen* aGen, break; } case SMESH_subMesh::HYP_OK: - algo = aGen->GetAlgo( aMesh, aSubMesh->GetSubShape() ); + algo = aSubMesh->GetAlgo(); ret = true; + if (!algo->NeedDiscreteBoundary()) + { + SMESH_subMeshIteratorPtr itsub = aSubMesh->getDependsOnIterator( /*includeSelf=*/false, + /*complexShapeFirst=*/false); + while ( itsub->more() ) + aCheckedMap.insert( itsub->next() ); + } break; default: ASSERT(0); } @@ -722,7 +730,6 @@ static bool checkMissing(SMESH_Gen* aGen, { // sub-meshes should not be checked further more SMESH_subMesh* sm = itsub->next(); - aCheckedMap.insert( sm ); if (isTopLocalAlgo) { @@ -736,6 +743,7 @@ static bool checkMissing(SMESH_Gen* aGen, checkNoAlgo2 = false; } } + aCheckedMap.insert( sm ); } } return ret; @@ -769,9 +777,9 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh, bool ret = true; bool hasAlgo = false; - SMESH_subMesh* sm = theMesh.GetSubMesh(theShape); + SMESH_subMesh* sm = theMesh.GetSubMesh(theShape); const SMESHDS_Mesh* meshDS = theMesh.GetMeshDS(); - TopoDS_Shape mainShape = meshDS->ShapeToMesh(); + TopoDS_Shape mainShape = meshDS->ShapeToMesh(); // ----------------- // get global algos