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

0024825: Fit Boolean Operation Algorithm to treat multiple arguments.

class BOPTest
class BOPAlgo_BOP
class BOPAlgo_Builder
class BOPTest
class BRepFeat_Builder
class BRepFeat_MakeCylindricalHole

The format of the command has been changed:
bbop r op [-s -t]
The following options has been added:
-s - run in serial mode
-t  - print the CPU time

Test cases for issue CR24825
This commit is contained in:
pkv
2014-04-17 16:04:29 +04:00
committed by apn
parent d7515f9afb
commit 8620e18d6e
16 changed files with 774 additions and 407 deletions

View File

@@ -198,19 +198,23 @@
void BRepFeat_Builder::FillRemoved()
{
TopExp_Explorer aExp;
aExp.Init(myArgs[0], TopAbs_SOLID);
//
const TopoDS_Shape& aArgs0=myArguments.First();
const TopoDS_Shape& aArgs1=myTools.First();
//
aExp.Init(aArgs0, TopAbs_SOLID);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aS = aExp.Current();
myImages.UnBind(aS);
}
//
if (!myImages.IsBound(myArgs[1])) {
if (!myImages.IsBound(aArgs1)) {
return;
}
//
BOPCol_ListIteratorOfListOfShape aItIm;
//
BOPCol_ListOfShape& aLS = myImages.ChangeFind(myArgs[1]);
BOPCol_ListOfShape& aLS = myImages.ChangeFind(aArgs1);
aItIm.Initialize(aLS);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aS = aItIm.Value();
@@ -675,8 +679,11 @@
BOPCol_ListIteratorOfListOfShape aIt;
TopExp_Explorer aExp, aExpF;
Standard_Boolean bFlagSD;
//
const TopoDS_Shape& aArgs0=myArguments.First();
const TopoDS_Shape& aArgs1=myTools.First();
//
const BOPCol_ListOfShape& aLSIm = myImages.Find(myArgs[1]);
const BOPCol_ListOfShape& aLSIm = myImages.Find(aArgs1);
aIt.Initialize(aLSIm);
for(;aIt.More();aIt.Next()) {
const TopoDS_Shape& aSolIm = aIt.Value();
@@ -686,7 +693,7 @@
aMST.Add(aST);
}
//
aExp.Init(myArgs[0], TopAbs_SOLID);
aExp.Init(aArgs0, TopAbs_SOLID);
for(; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aSolid = aExp.Current();
if (myImages.IsBound(aSolid)) {

View File

@@ -56,14 +56,15 @@ static void BoxParameters(const TopoDS_Shape&,
void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
{
if (Object().IsNull() || !myAxDef) {
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
Standard_ConstructionError::Raise();
}
myIsBlind = Standard_False;
myStatus = BRepFeat_NoError;
LocOpe_CurveShapeIntersector theASI(myAxis,Object());
LocOpe_CurveShapeIntersector theASI(myAxis,aObject);
if (!theASI.IsDone() || theASI.NbPoints() <= 0) {
myStatus = BRepFeat_InvalidPlacement;
return;
@@ -76,7 +77,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
// It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax;
BoxParameters(Object(),myAxis,PMin,PMax);
BoxParameters(aObject,myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin);
gp_XYZ theOrig = myAxis.Location().XYZ();
theOrig += ((3.*PMin-PMax)/2.) * myAxis.Direction().XYZ();
@@ -102,9 +103,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
//
AddTool(theTool);
SetOperation(Fuse);
BOPAlgo_Builder::Perform();
//myBuilder.Perform(theTool,theList,Fuse);
// myBuilder.PerformResult();
BOPAlgo_BOP::Perform();
}
@@ -116,8 +115,9 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
const Standard_Boolean Cont)
{
if (Object().IsNull() || !myAxDef) {
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
Standard_ConstructionError::Raise();
}
@@ -125,7 +125,7 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
myValidate = Cont;
myStatus = BRepFeat_NoError;
LocOpe_CurveShapeIntersector theASI(myAxis,Object());
LocOpe_CurveShapeIntersector theASI(myAxis,aObject);
if (!theASI.IsDone()) {
myStatus = BRepFeat_InvalidPlacement;
return;
@@ -180,7 +180,7 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
// It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax;
BoxParameters(Object(),myAxis,PMin,PMax);
BoxParameters(aObject,myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin);
gp_XYZ theOrig = myAxis.Location().XYZ();
theOrig += ((3.*PMin-PMax)/2.) * myAxis.Direction().XYZ();
@@ -274,8 +274,9 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
const Standard_Boolean Cont)
{
if (Object().IsNull() || !myAxDef) {
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
Standard_ConstructionError::Raise();
}
@@ -283,7 +284,7 @@ void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
myValidate = Cont;
myStatus = BRepFeat_NoError;
LocOpe_CurveShapeIntersector theASI(myAxis,Object());
LocOpe_CurveShapeIntersector theASI(myAxis,aObject);
if (!theASI.IsDone()) {
myStatus = BRepFeat_InvalidPlacement;
return;
@@ -330,7 +331,7 @@ void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
// It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax;
BoxParameters(Object(),myAxis,PMin,PMax);
BoxParameters(aObject,myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin);
gp_XYZ theOrig = myAxis.Location().XYZ();
theOrig += ((3.*PMin-PMax)/2.) * myAxis.Direction().XYZ();
@@ -392,8 +393,9 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
const Standard_Real PTo,
const Standard_Boolean Cont)
{
if (Object().IsNull() || !myAxDef) {
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
Standard_ConstructionError::Raise();
}
@@ -401,7 +403,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
myValidate = Cont;
myStatus = BRepFeat_NoError;
LocOpe_CurveShapeIntersector theASI(myAxis,Object());
LocOpe_CurveShapeIntersector theASI(myAxis,aObject);
if (!theASI.IsDone()) {
myStatus = BRepFeat_InvalidPlacement;
return;
@@ -458,7 +460,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
// // It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax;
BoxParameters(Object(),myAxis,PMin,PMax);
BoxParameters(aObject,myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin);
gp_XYZ theOrig = myAxis.Location().XYZ();
theOrig += ((3.*PMin-PMax)/2.) * myAxis.Direction().XYZ();
@@ -522,8 +524,9 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
const Standard_Real Length,
const Standard_Boolean Cont)
{
if (Object().IsNull() || !myAxDef || Length <= 0.) {
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef || Length <= 0.) {
Standard_ConstructionError::Raise();
}
@@ -531,7 +534,7 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
myValidate = Cont;
myStatus = BRepFeat_NoError;
LocOpe_CurveShapeIntersector theASI(myAxis,Object());
LocOpe_CurveShapeIntersector theASI(myAxis,aObject);
if (!theASI.IsDone()) {
myStatus = BRepFeat_InvalidPlacement;
return;
@@ -582,7 +585,7 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
//// It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax;
BoxParameters(Object(),myAxis,PMin,PMax);
BoxParameters(aObject,myAxis,PMin,PMax);
if (PMin > Length) {
myStatus = BRepFeat_InvalidPlacement;
return;