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

0028776: Extend the field BOPAlgo_Builder::myOrigins so that the shape could have multiple origins

Change the type of the field BOPAlgo_Builder::myOrigins so that the new shape could have multiple origins in case of overlapping.
This commit is contained in:
emv
2017-05-03 15:42:53 +03:00
committed by bugmaster
parent c8425f03ff
commit b18a83d4a7
9 changed files with 100 additions and 30 deletions

View File

@@ -1200,20 +1200,34 @@ Standard_Integer boporigin(Draw_Interpretor& di,
return 0;
}
//
char buf[32];
//
BOPAlgo_Builder& aBuilder = BOPTest_Objects::Builder();
const BOPCol_DataMapOfShapeShape& aDMI = aBuilder.Origins();
const BOPCol_DataMapOfShapeListOfShape& aDMI = aBuilder.Origins();
if (!aDMI.IsBound(aS)) {
di << " no origins found\n";
return 0;
}
//
const TopoDS_Shape& aSx = aDMI.Find(aS);
//
char buf[32];
sprintf(buf, "%s_or", a[1]);
DBRep::Set(buf, aSx);
//
const BOPCol_ListOfShape& aLSx = aDMI.Find(aS);
if (aLSx.Extent() == 1) {
DBRep::Set(buf, aLSx.First());
di << "1 origin found\n" << buf << "\n";
return 0;
}
//
TopoDS_Compound aCOr;
BRep_Builder().MakeCompound(aCOr);
//
BOPCol_ListIteratorOfListOfShape aItLSx(aLSx);
for (; aItLSx.More(); aItLSx.Next()) {
BRep_Builder().Add(aCOr, aItLSx.Value());
}
//
DBRep::Set(buf, aCOr);
//
di << aLSx.Extent() << " origins found\n";
di << buf << "\n";
//
return 0;