From f6e782581430a63c46b6d1f1b3b83d99ea22f6b0 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 9 Jun 2011 07:56:06 +0000 Subject: [PATCH] Mantis issue 0021291: [CEA 480] Bad performance of glue function in 6.3.0. --- src/GEOMAlgo/GEOMAlgo_Gluer2.cxx | 1 - src/GEOMAlgo/GEOMAlgo_Gluer2_3.cxx | 36 +++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx b/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx index 6d26dfea1..b6e0558e4 100644 --- a/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Gluer2.cxx @@ -19,7 +19,6 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File: GEOMAlgo_Gluer2.cxx // Author: Peter KURNEV diff --git a/src/GEOMAlgo/GEOMAlgo_Gluer2_3.cxx b/src/GEOMAlgo/GEOMAlgo_Gluer2_3.cxx index b6ab53be9..d39bb4f90 100644 --- a/src/GEOMAlgo/GEOMAlgo_Gluer2_3.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Gluer2_3.cxx @@ -22,8 +22,7 @@ // File: GEOMAlgo_Gluer2_3.cxx // Created: // Author: Peter KURNEV -// -// + #include #include @@ -332,16 +331,41 @@ void MapShapes1(const TopoDS_Shape& aS, const TopAbs_ShapeEnum aType, TopTools_IndexedMapOfShape& aM) { - TopExp_Explorer aEx (aS, aType); - while (aEx.More()) { - const TopoDS_Shape aSx=aEx.Current(); + TopExp_Explorer aExp; + + aExp.Init (aS, aType); + for ( ;aExp.More(); aExp.Next()) { + const TopoDS_Shape aSx=aExp.Current(); + if (aType==TopAbs_EDGE) { + const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aSx); + if (BRep_Tool::Degenerated(aEx)) { + continue; + } + } + aM.Add(aSx); + } +} +/* +//======================================================================= +//function : MapShapes1 +//purpose : +//======================================================================= +void MapShapes1(const TopoDS_Shape& aS, + const TopAbs_ShapeEnum aType, + TopTools_IndexedMapOfShape& aM) +{ + TopExp_Explorer aExp (aS, aType); + while (aExp.More()) { + const TopoDS_Shape aSx=aExp.Current(); if (aType==TopAbs_EDGE) { const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aSx); if (BRep_Tool::Degenerated(aEx)) { + aExp.Next(); continue; } } aM.Add(aSx); - aEx.Next(); + aExp.Next(); } } +*/ -- 2.39.2