From 76cb7d05c40dbb1ea539b173846d5cc6c18c1905 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 14 Mar 2012 11:28:26 +0000 Subject: [PATCH] Mantis issue 0021501: [CEA] Non regression test fails on MakePartition. A fix by PKV. --- src/GEOMAlgo_NEW/GEOMAlgo_BuilderSolid.cxx | 31 +++++++++++++---- src/GEOMAlgo_NEW/GEOMAlgo_Builder_2.cxx | 39 +++++++++++++++++++++- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/src/GEOMAlgo_NEW/GEOMAlgo_BuilderSolid.cxx b/src/GEOMAlgo_NEW/GEOMAlgo_BuilderSolid.cxx index fe5b1d554..9c22ffd94 100644 --- a/src/GEOMAlgo_NEW/GEOMAlgo_BuilderSolid.cxx +++ b/src/GEOMAlgo_NEW/GEOMAlgo_BuilderSolid.cxx @@ -390,7 +390,6 @@ void GEOMAlgo_BuilderSolid::PerformLoops() if (IsClosedShell(aShell)) { myLoops.Append(aShell); } - //modified by NIZNHY-PKV Wed Oct 27 07:10:41 2010f else { Standard_Boolean bRefine; TopoDS_Shell aShx; @@ -400,7 +399,6 @@ void GEOMAlgo_BuilderSolid::PerformLoops() myLoops.Append(aShx); } } - //modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t } // for (; aItF.More(); aItF.Next()) { // // Post Treatment @@ -611,10 +609,11 @@ void GEOMAlgo_BuilderSolid::PerformInternalShapes() return; } // + Standard_Integer bFlag; BRep_Builder aBB; TopTools_ListIteratorOfListOfShape aShellIt, aSolidIt; TopoDS_Iterator aIt; - TopTools_MapOfShape aMF, aMFP; + TopTools_MapOfShape aMF, aMFP, aMFS; TopTools_MapIteratorOfMapOfShape aItMF; TopTools_IndexedDataMapOfShapeListOfShape aMEF; TopTools_ListOfShape aLSI; @@ -636,6 +635,16 @@ void GEOMAlgo_BuilderSolid::PerformInternalShapes() for ( ; aSolidIt.More(); aSolidIt.Next()) { TopoDS_Solid& aSolid=*((TopoDS_Solid*)(&aSolidIt.Value())); // + //modified by NIZNHY-PKV Wed Mar 07 08:52:18 2012f + aMFS.Clear(); + { + TopExp_Explorer aExp(aSolid, TopAbs_FACE); + while (aExp.More()) { + aMFS.Add(aExp.Current()); + aExp.Next(); + } + } + //modified by NIZNHY-PKV Wed Mar 07 08:52:20 2012t aMEF.Clear(); TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF); // @@ -644,9 +653,17 @@ void GEOMAlgo_BuilderSolid::PerformInternalShapes() aItMF.Initialize(aMF); for (; aItMF.More(); aItMF.Next()) { const TopoDS_Face& aF=*((TopoDS_Face*)(&aItMF.Key())); - if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, myContext)) { - aMFP.Add(aF); + //modified by NIZNHY-PKV Wed Mar 07 08:54:56 2012f + if (!aMFS.Contains(aF)) { + bFlag=GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, myContext); + if (bFlag) { + aMFP.Add(aF); + } } + //if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, myContext)) { + // aMFP.Add(aF); + //} + //modified by NIZNHY-PKV Wed Mar 07 08:56:07 2012t } // // 2.2 Make Internal Shells @@ -832,8 +849,8 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell) //function : RefineShell //purpose : //======================================================================= - Standard_Boolean RefineShell(const TopoDS_Shell& aShell, - TopoDS_Shell& aShx) +Standard_Boolean RefineShell(const TopoDS_Shell& aShell, + TopoDS_Shell& aShx) { Standard_Boolean bRet; diff --git a/src/GEOMAlgo_NEW/GEOMAlgo_Builder_2.cxx b/src/GEOMAlgo_NEW/GEOMAlgo_Builder_2.cxx index 7a3fa9be0..9a77a113a 100644 --- a/src/GEOMAlgo_NEW/GEOMAlgo_Builder_2.cxx +++ b/src/GEOMAlgo_NEW/GEOMAlgo_Builder_2.cxx @@ -101,6 +101,11 @@ static const Standard_Integer , NMTTools_IndexedDataMapOfIndexedMapOfInteger& ); +//modified by NIZNHY-PKV Thu Feb 16 12:24:52 2012f +static + Standard_Boolean IsClosed(const TopoDS_Edge& , + const TopoDS_Face& ); +//modified by NIZNHY-PKV Thu Feb 16 12:24:56 2012t //======================================================================= //function : FillImagesFaces @@ -307,7 +312,10 @@ void GEOMAlgo_Builder::BuildSplitFaces() } // bIsDegenerated=BRep_Tool::Degenerated(aE); - bIsClosed=BRep_Tool::IsClosed(aE, aF); + //modified by NIZNHY-PKV Wed Mar 07 07:46:09 2012f + bIsClosed=IsClosed(aE, aF); + //bIsClosed=BRep_Tool::IsClosed(aE, aF); + //modified by NIZNHY-PKV Wed Mar 07 07:46:13 2012t // const TopTools_ListOfShape& aLIE=myImages.Image(aE); aIt.Initialize(aLIE); @@ -929,6 +937,35 @@ void UpdateCandidates(const Standard_Integer theNF, } } +//modified by NIZNHY-PKV Thu Feb 16 12:25:16 2012f +//======================================================================= +//function : IsClosed +//purpose : +//======================================================================= +Standard_Boolean IsClosed(const TopoDS_Edge& aE, + const TopoDS_Face& aF) +{ + Standard_Boolean bRet; + // + bRet=BRep_Tool::IsClosed(aE, aF); + if (bRet) { + TopTools_MapOfShape aM; + TopExp_Explorer aExp(aF, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aEx=aExp.Current(); + // + if (aM.Add(aEx)) { + bRet=aEx.IsSame(aE); + if (bRet) { + break; + } + } + } + } + return bRet; +} +//modified by NIZNHY-PKV Thu Feb 16 12:25:25 2012t + /* { TopoDS_Compound aCx; -- 2.39.2