From c4edd925fd129bba6f9743eee4a84cdb827e4d9f Mon Sep 17 00:00:00 2001 From: pdn Date: Thu, 28 Nov 2013 10:45:18 +0400 Subject: [PATCH] 0024385: Shape fix shape does not correct closed flag for shell Modified test cases de/step_4/C9 and de/step_4/D1 regarding to new reference data --- src/ShapeFix/ShapeFix_Shell.cxx | 17 ++++++++++++----- tests/de/step_4/C9 | 5 ++++- tests/de/step_4/D1 | 5 ++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/ShapeFix/ShapeFix_Shell.cxx b/src/ShapeFix/ShapeFix_Shell.cxx index 59b9e02a4d..e8d98bb154 100755 --- a/src/ShapeFix/ShapeFix_Shell.cxx +++ b/src/ShapeFix/ShapeFix_Shell.cxx @@ -871,12 +871,19 @@ Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,co TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces; TopExp::MapShapesAndAncestors(myShell,TopAbs_EDGE,TopAbs_FACE,aMapEdgeFaces); TopTools_MapOfShape aMapMultiConnectEdges; - if(isAccountMultiConex) { + Standard_Boolean isFreeBoundaries = Standard_False; + for(Standard_Integer k = 1; k <= aMapEdgeFaces.Extent(); k++) { + Standard_Integer aFaceCount = aMapEdgeFaces.FindFromIndex(k).Extent(); //Finds multishared edges - for(Standard_Integer k = 1; k <= aMapEdgeFaces.Extent(); k++) { - if(aMapEdgeFaces.FindFromIndex(k).Extent() >2) - aMapMultiConnectEdges.Add(aMapEdgeFaces.FindKey(k)); - } + if (isAccountMultiConex && aFaceCount > 2) + aMapMultiConnectEdges.Add(aMapEdgeFaces.FindKey(k)); + if (aFaceCount == 1) + isFreeBoundaries = Standard_True; + } + if (BRep_Tool::IsClosed (myShell) == isFreeBoundaries) + { + myShell.Closed (!isFreeBoundaries); + SendWarning (Message_Msg ("FixAdvShell.FixClosedFlag.MSG0"));//Shell has incorrect flag isClosed } Standard_Boolean isGetShells = Standard_True; //Gets possible shells with taking in account of multiconnexity. diff --git a/tests/de/step_4/C9 b/tests/de/step_4/C9 index 3a22d49bde..2e9f31df44 100644 --- a/tests/de/step_4/C9 +++ b/tests/de/step_4/C9 @@ -1,9 +1,12 @@ # !!!! This file is generated automatically, do not edit manually! See end script +puts "TODO CR23096 ALL: TPSTAT : Faulty" + + set filename db_exhaust-A.stp set ref_data { DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 ) -TPSTAT : Faulties = 0 ( 0 ) Warnings = 6 ( 6 ) Summary = 6 ( 6 ) +TPSTAT : Faulties = 0 ( 0 ) Warnings = 7 ( 6 ) Summary = 7 ( 6 ) CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 ) NBSHAPES : Solid = 3 ( 3 ) Shell = 3 ( 3 ) Face = 41 ( 41 ) Summary = 617 ( 612 ) STATSHAPE : Solid = 3 ( 3 ) Shell = 3 ( 3 ) Face = 41 ( 41 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 280 ( 275 ) diff --git a/tests/de/step_4/D1 b/tests/de/step_4/D1 index 1e0c419683..e0af3cb439 100644 --- a/tests/de/step_4/D1 +++ b/tests/de/step_4/D1 @@ -1,9 +1,12 @@ # !!!! This file is generated automatically, do not edit manually! See end script +puts "TODO CR23096 ALL: TPSTAT : Faulty" + + set filename db_exhaust-B.stp set ref_data { DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 ) -TPSTAT : Faulties = 0 ( 0 ) Warnings = 6 ( 6 ) Summary = 6 ( 6 ) +TPSTAT : Faulties = 0 ( 0 ) Warnings = 7 ( 6 ) Summary = 7 ( 6 ) CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 ) NBSHAPES : Solid = 3 ( 3 ) Shell = 3 ( 3 ) Face = 41 ( 41 ) Summary = 617 ( 612 ) STATSHAPE : Solid = 3 ( 3 ) Shell = 3 ( 3 ) Face = 41 ( 41 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 280 ( 275 )