From: eap Date: Fri, 24 Jun 2005 11:01:15 +0000 (+0000) Subject: PAL8196. Fix GetAlgo() for the case with the same algo on several ancestors X-Git-Tag: T3_0_0_a4~8 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=72b3cba0354ae8093f207f77ba1bc0064ac9b31b;ds=sidebyside PAL8196. Fix GetAlgo() for the case with the same algo on several ancestors --- diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 143c05296..7a3c34a50 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -602,9 +602,18 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) list algoList; aMesh.GetHypotheses( aShape, filter, algoList, true ); - if (algoList.size() != 1 ) + + if ( algoList.empty() ) return NULL; + if (algoList.size() > 1 ) { // check if there is one algo several times + list ::iterator algo = algoList.begin(); + for ( ; algo != algoList.end(); ++algo ) + if ( (*algo) != algoList.front() && + (*algo)->GetName() != algoList.front()->GetName() ) + return NULL; + } + return const_cast ( static_cast( algoList.front() )); }