mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028259: Method MakeBlocksCnx is duplicated in two different places in BOPAlgo
The methods BOPAlgo_Tools::MakeBlocksCnx(), BOPAlgo_Tools::MakeBlocks() and static method MakeBlocksCnx in BOPAlgo_Builder_2.cxx have been replaced with the new template method BOPAlgo_Tools::MakeBlocks(). The blocks of connected elements are now stored into the list of list instead of data map. All methods BOPAlgo_Tools::FillMap() have been replaced with the new template method BOPAlgo_Tools::FillMap(). Making the Pave Block with the smallest index of original edge to be the first in the Common Block (i.e. the representing Pave Block). The following improvements have been made in Boolean Operations algorithm to avoid regressions: - When updating the existing common block update its pave blocks in a way that the parameters of the paves should be valid for the original edge (bugs/modalg_5/bug24809); - When trying to reduce the tolerance of the section edge check the tolerance of all Face/Face interferences that created this edge (boolean/volumemaker/C4,D2); - Avoid producing the different Pave Blocks for the same section edge (boolean/volumemaker/D6); Adjustment of the test cases.
This commit is contained in:
@@ -118,88 +118,53 @@ static
|
||||
// function: MakeConnexityBlocks
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools::MakeConnexityBlocks
|
||||
void BOPTools_AlgoTools::MakeConnexityBlocks
|
||||
(const TopoDS_Shape& theS,
|
||||
const TopAbs_ShapeEnum theType1,
|
||||
const TopAbs_ShapeEnum theType2,
|
||||
BOPCol_ListOfShape& theLCB)
|
||||
{
|
||||
Standard_Integer aNbF, aNbAdd, aNbAdd1, i;
|
||||
// Map shapes to find connected elements
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS;
|
||||
BOPTools::MapShapesAndAncestors(theS, theType1, theType2, aDMSLS);
|
||||
// Fence map
|
||||
BOPCol_MapOfShape aMFence;
|
||||
Standard_Integer i;
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Compound aC;
|
||||
TopoDS_Iterator aIt;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_MapOfShape aMP;
|
||||
BOPCol_IndexedMapOfShape aMCB, aMAdd, aMAdd1;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF;
|
||||
//
|
||||
// 1. aMEF
|
||||
BOPTools::MapShapesAndAncestors(theS, theType1, theType2, aMEF);
|
||||
//
|
||||
// 2. aMCB
|
||||
aIt.Initialize(theS);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aF1=aIt.Value();
|
||||
if (aMP.Contains(aF1)) {
|
||||
TopExp_Explorer aExp(theS, theType2);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aS = aExp.Current();
|
||||
if (!aMFence.Add(aS)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aMCB.Clear();
|
||||
aMAdd.Clear();
|
||||
aMAdd.Add(aF1);
|
||||
//
|
||||
for(;;) {
|
||||
aMAdd1.Clear();
|
||||
//
|
||||
aNbAdd = aMAdd.Extent();
|
||||
for (i=1; i<=aNbAdd; ++i) {
|
||||
const TopoDS_Shape& aF=aMAdd(i);
|
||||
//
|
||||
aExp.Init(aF, theType1);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aE=aExp.Current();
|
||||
//
|
||||
const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aE);
|
||||
aItLF.Initialize(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Shape& aFx=aItLF.Value();
|
||||
if (aFx.IsSame(aF)) {
|
||||
continue;
|
||||
}
|
||||
if (aMCB.Contains(aFx)) {
|
||||
continue;
|
||||
}
|
||||
aMAdd1.Add(aFx);
|
||||
// The block
|
||||
BOPCol_IndexedMapOfShape aMBlock;
|
||||
TopoDS_Compound aBlock;
|
||||
aBB.MakeCompound(aBlock);
|
||||
// Start the block
|
||||
aMBlock.Add(aS);
|
||||
aBB.Add(aBlock, aS);
|
||||
// Look for connected parts
|
||||
for (i = 1; i <= aMBlock.Extent(); ++i) {
|
||||
const TopoDS_Shape& aS1 = aMBlock(i);
|
||||
TopExp_Explorer aExpSS(aS1, theType1);
|
||||
for (; aExpSS.More(); aExpSS.Next()) {
|
||||
const TopoDS_Shape& aSubS = aExpSS.Current();
|
||||
const BOPCol_ListOfShape& aLS = aDMSLS.FindFromKey(aSubS);
|
||||
BOPCol_ListIteratorOfListOfShape aItLS(aLS);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aS2 = aItLS.Value();
|
||||
if (aMFence.Add(aS2)) {
|
||||
aMBlock.Add(aS2);
|
||||
aBB.Add(aBlock, aS2);
|
||||
}
|
||||
}//for (; aExp.More(); aExp.Next()){
|
||||
aMCB.Add(aF);
|
||||
}// for (i=1; i<=aNbAdd; ++i) {
|
||||
//
|
||||
aNbAdd1=aMAdd1.Extent();
|
||||
if (!aNbAdd1) {
|
||||
break;// ->make new CB from aMCB
|
||||
}
|
||||
}
|
||||
//
|
||||
aMAdd.Clear();
|
||||
for (i=1; i<=aNbAdd1; ++i) {
|
||||
const TopoDS_Shape& aFAdd = aMAdd1(i);
|
||||
aMAdd.Add(aFAdd);
|
||||
}
|
||||
}//while(1) {
|
||||
//
|
||||
aNbF=aMCB.Extent();
|
||||
if (aNbF) {
|
||||
aBB.MakeCompound(aC);
|
||||
//
|
||||
for (i=1; i<=aNbF; ++i) {
|
||||
const TopoDS_Shape& aF=aMCB(i);
|
||||
aBB.Add(aC, aF);
|
||||
aMP.Add(aF);
|
||||
}
|
||||
theLCB.Append(aC);
|
||||
}
|
||||
}// for (; aIt.More(); aIt.Next())
|
||||
// Add the block into result
|
||||
theLCB.Append(aBlock);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
// function: OrientEdgesOnWire
|
||||
|
Reference in New Issue
Block a user