1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030151: Modeling Algorithms - Removal of the API level of old Boolean operations algorithm (BRepAlgo_BooleanOperation)

The following classes have been removed as obsolete:
- BRepAlgo_BooleanOperation
- BRepAlgo_Fuse
- BRepAlgo_Cut
- BRepAlgo_Common
- BRepAlgo_Section

The corresponding classes from BRepAlgoAPI package have to be used instead.

Draw commands:
- fuse
- cut
- common
- section/psection
have also been removed as obsolete.

The corresponding commands for modern Boolean operations algorithm (bfuse/bcut/bcommon/bsection) have to be used instead.

Adjustment of the test cases to use the commands for modern algorithm.
This commit is contained in:
emv
2018-09-21 11:43:16 +03:00
committed by smoskvin
parent 35ad04e78b
commit efac173377
41 changed files with 185 additions and 2591 deletions

View File

@@ -32,7 +32,6 @@
#include <BRepAdaptor_Surface.hxx>
#include <BRepAlgo_AsDes.hxx>
#include <BRepAlgo_Image.hxx>
#include <BRepAlgo_Tool.hxx>
#include <BRepBndLib.hxx>
#include <BRepLib.hxx>
#include <BRepLib_MakeEdge.hxx>
@@ -3901,11 +3900,73 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
//function : Deboucle3D
//purpose :
//=======================================================================
TopoDS_Shape BRepOffset_Tool::Deboucle3D(const TopoDS_Shape& S,
const TopTools_MapOfShape& Boundary)
const TopTools_MapOfShape& Boundary)
{
return BRepAlgo_Tool::Deboucle3D(S,Boundary);
TopoDS_Shape SS;
switch (S.ShapeType())
{
case TopAbs_SHELL:
{
// if the shell contains free borders that do not belong to the
// free borders of caps ( Boundary) it is removed.
TopTools_IndexedDataMapOfShapeListOfShape Map;
TopExp::MapShapesAndAncestors(S, TopAbs_EDGE, TopAbs_FACE, Map);
Standard_Boolean JeGarde = Standard_True;
for (Standard_Integer i = 1; i <= Map.Extent() && JeGarde; i++) {
const TopTools_ListOfShape& aLF = Map(i);
if (aLF.Extent() < 2) {
const TopoDS_Edge& anEdge = TopoDS::Edge(Map.FindKey(i));
if (anEdge.Orientation() == TopAbs_INTERNAL) {
const TopoDS_Face& aFace = TopoDS::Face(aLF.First());
if (aFace.Orientation() != TopAbs_INTERNAL) {
continue;
}
}
if (!Boundary.Contains(anEdge) &&
!BRep_Tool::Degenerated(anEdge))
JeGarde = Standard_False;
}
}
if (JeGarde) SS = S;
}
break;
case TopAbs_COMPOUND:
case TopAbs_SOLID:
{
// iterate on sub-shapes and add non-empty.
TopoDS_Iterator it(S);
TopoDS_Shape SubShape;
Standard_Integer NbSub = 0;
BRep_Builder B;
if (S.ShapeType() == TopAbs_COMPOUND) {
B.MakeCompound(TopoDS::Compound(SS));
}
else {
B.MakeSolid(TopoDS::Solid(SS));
}
for (; it.More(); it.Next()) {
const TopoDS_Shape& CurS = it.Value();
SubShape = Deboucle3D(CurS, Boundary);
if (!SubShape.IsNull()) {
B.Add(SS, SubShape);
NbSub++;
}
}
if (NbSub == 0)
{
SS = TopoDS_Shape();
}
}
break;
default:
break;
}
return SS;
}
//=======================================================================