From 72b3cba0354ae8093f207f77ba1bc0064ac9b31b Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 24 Jun 2005 11:01:15 +0000 Subject: [PATCH] PAL8196. Fix GetAlgo() for the case with the same algo on several ancestors --- src/SMESH/SMESH_Gen.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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() )); } -- 2.39.2