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