From c24470c4ace987e9d0b652984638f511c51e795e Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 24 Jun 2005 10:52:06 +0000 Subject: [PATCH] PAL8196. Fix GetAlgo() for the case with the same algo on several ancestors --- src/SMESH/SMESH_Gen.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 143c05296..a6e1bd550 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -602,8 +602,14 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) list algoList; aMesh.GetHypotheses( aShape, filter, algoList, true ); - if (algoList.size() != 1 ) - 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() )); } -- 2.39.2