From 68064d7bc3806c775cd5bd3a6b16bc25c7788148 Mon Sep 17 00:00:00 2001 From: antonavt Date: Mon, 2 Mar 2020 12:16:14 +0300 Subject: [PATCH] 0028880: Modeling Algorithms - add missing BRepFeat_SplitShape::Right() getter - Added Right() method to BRepFeat_SplitShape; - Added an option in command buc60854, which allows to select Left() or Right() method; - Modified method BUC60854 in QABugs_14.cxx; - Added new option to the help of command buc60854; - Modified test case buc60854. Now its state is "OK"; - Added check Right() in buc60854 test case. --- src/BRepFeat/BRepFeat_SplitShape.cxx | 29 ++++++++++++++++++++++++++++ src/BRepFeat/BRepFeat_SplitShape.hxx | 5 +++++ src/QABugs/QABugs_14.cxx | 18 ++++++++++++++--- tests/bugs/moddata_1/buc60854 | 24 ++++++++++++++--------- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/src/BRepFeat/BRepFeat_SplitShape.cxx b/src/BRepFeat/BRepFeat_SplitShape.cxx index 6d0e7b43bd..2a559c05fa 100644 --- a/src/BRepFeat/BRepFeat_SplitShape.cxx +++ b/src/BRepFeat/BRepFeat_SplitShape.cxx @@ -27,6 +27,7 @@ #include #include #include +#include //======================================================================= //function : Build @@ -38,6 +39,7 @@ void BRepFeat_SplitShape::Build () if (mySShape.IsDone()) { Done(); myShape = mySShape.ResultingShape(); + myRight.Clear(); } } @@ -64,6 +66,33 @@ const TopTools_ListOfShape& BRepFeat_SplitShape::Left() const return mySShape.Left(); } + +//======================================================================= +//function : Right +//purpose : +//======================================================================= + +const TopTools_ListOfShape& BRepFeat_SplitShape::Right() const +{ + if (myRight.IsEmpty()) + { + TopTools_MapOfShape aMapOfLeft; + TopTools_ListIteratorOfListOfShape anIterator; + for (anIterator.Initialize(mySShape.Left()); anIterator.More(); anIterator.Next()) + { + aMapOfLeft.Add(anIterator.Value()); + } + TopExp_Explorer anExplorer; + for (anExplorer.Init(myShape, TopAbs_FACE); anExplorer.More(); anExplorer.Next()) + { + const TopoDS_Shape& aFace = anExplorer.Current(); + if (!aMapOfLeft.Contains(aFace)) + myRight.Append(aFace); + } + } + return myRight; +} + //======================================================================= //function : isDeleted //purpose : diff --git a/src/BRepFeat/BRepFeat_SplitShape.hxx b/src/BRepFeat/BRepFeat_SplitShape.hxx index 17941df08f..dad7cd0c7c 100644 --- a/src/BRepFeat/BRepFeat_SplitShape.hxx +++ b/src/BRepFeat/BRepFeat_SplitShape.hxx @@ -105,6 +105,9 @@ public: //! Raises NotDone if IsDone returns . Standard_EXPORT const TopTools_ListOfShape& Left() const; + //! Returns the faces of the "right" part on the shape. + Standard_EXPORT const TopTools_ListOfShape& Right() const; + //! Builds the cut and the resulting faces and edges as well. Standard_EXPORT void Build() Standard_OVERRIDE; @@ -130,6 +133,8 @@ private: LocOpe_Spliter mySShape; Handle(LocOpe_WiresOnShape) myWOnShape; + mutable TopTools_ListOfShape myRight; + }; diff --git a/src/QABugs/QABugs_14.cxx b/src/QABugs/QABugs_14.cxx index 796f048ded..c49cb76940 100644 --- a/src/QABugs/QABugs_14.cxx +++ b/src/QABugs/QABugs_14.cxx @@ -239,7 +239,8 @@ static Standard_Integer BUC60854 (Draw_Interpretor& /*di*/, Standard_Integer arg else return 1; } - for (i++; i