Fix from EMV for some regressions on new bop

This commit is contained in:
vsr 2012-12-18 08:29:02 +00:00
parent 71ad3d7eba
commit 215bd2c8fc

View File

@ -44,7 +44,7 @@
static static
void TreatCompound(const TopoDS_Shape& aC, void TreatCompound(const TopoDS_Shape& aC,
BOPCol_ListOfShape& aLSX); BOPCol_ListOfShape& aLSX);
//======================================================================= //=======================================================================
//function : //function :
@ -162,19 +162,19 @@ void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType)
aType=aS.ShapeType(); aType=aS.ShapeType();
if (aType==theType && !myMapTools.Contains(aS)) { if (aType==theType && !myMapTools.Contains(aS)) {
if (myImages.IsBound(aS)) { if (myImages.IsBound(aS)) {
const BOPCol_ListOfShape& aLSIm=myImages.Find(aS); const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
aItIm.Initialize(aLSIm); aItIm.Initialize(aLSIm);
for (; aItIm.More(); aItIm.Next()) { for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSIm=aItIm.Value(); const TopoDS_Shape& aSIm=aItIm.Value();
if (aM.Add(aSIm)) { if (aM.Add(aSIm)) {
aBB.Add(myShape, aSIm); aBB.Add(myShape, aSIm);
} }
} }
} }
else { else {
if (aM.Add(aS)) { if (aM.Add(aS)) {
aBB.Add(myShape, aS); aBB.Add(myShape, aS);
} }
} }
} }
} }
@ -211,55 +211,61 @@ void GEOMAlgo_Splitter::PostTreat()
// 1. Collect the shapes to process aLSP // 1. Collect the shapes to process aLSP
aIt.Initialize(myArguments); aIt.Initialize(myArguments);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value(); const TopoDS_Shape& aS=aIt.Value();
if (myMapTools.Contains(aS)) { if (myMapTools.Contains(aS)) {
continue; continue;
} }
// //
aType=aS.ShapeType(); aType=aS.ShapeType();
iType=(Standard_Integer)aType; iType=(Standard_Integer)aType;
// //
if (iType>iLimit) { if (iType>iLimit) {
aLSP.Append(aS); aLSP.Append(aS);
} }
// //
else if (aType==TopAbs_COMPOUND) { else if (aType==TopAbs_COMPOUND) {
aLSX.Clear(); aLSX.Clear();
// //
TreatCompound(aS, aLSX); TreatCompound(aS, aLSX);
// //
aItX.Initialize(aLSX); aItX.Initialize(aLSX);
for (; aItX.More(); aItX.Next()) { for (; aItX.More(); aItX.Next()) {
const TopoDS_Shape& aSX=aItX.Value(); const TopoDS_Shape& aSX=aItX.Value();
aTypeX=aSX.ShapeType(); aTypeX=aSX.ShapeType();
iTypeX=(Standard_Integer)aTypeX; iTypeX=(Standard_Integer)aTypeX;
// //
if (iTypeX>iLimit) { if (iTypeX>iLimit) {
aLSP.Append(aSX); aLSP.Append(aSX);
} }
} }
} }
}// for (; aIt.More(); aIt.Next()) { }// for (; aIt.More(); aIt.Next()) {
// //
// 2. Add them to aC aMx.Clear();
BOPTools::MapShapes(aC, aMx);
// 2. Add them to aC
aIt.Initialize(aLSP); aIt.Initialize(aLSP);
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value(); const TopoDS_Shape& aS=aIt.Value();
if (myImages.IsBound(aS)) { if (myImages.IsBound(aS)) {
const BOPCol_ListOfShape& aLSIm=myImages.Find(aS); const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
aItIm.Initialize(aLSIm); aItIm.Initialize(aLSIm);
for (; aItIm.More(); aItIm.Next()) { for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSIm=aItIm.Value(); const TopoDS_Shape& aSIm=aItIm.Value();
if (aM.Add(aSIm)) { if (aM.Add(aSIm)) {
aBB.Add(aC, aSIm); if (!aMx.Contains(aSIm)) {
} aBB.Add(aC, aSIm);
} }
} }
else { }
if (aM.Add(aS)) { }
aBB.Add(aC, aS); else {
} if (aM.Add(aS)) {
} if (!aMx.Contains(aS)) {
aBB.Add(aC, aS);
}
}
}
} }
}// if (myLimitMode) { }// if (myLimitMode) {
myShape=aC; myShape=aC;
@ -272,7 +278,7 @@ void GEOMAlgo_Splitter::PostTreat()
//purpose : //purpose :
//======================================================================= //=======================================================================
void TreatCompound(const TopoDS_Shape& aC1, void TreatCompound(const TopoDS_Shape& aC1,
BOPCol_ListOfShape& aLSX) BOPCol_ListOfShape& aLSX)
{ {
Standard_Integer aNbC1; Standard_Integer aNbC1;
TopAbs_ShapeEnum aType; TopAbs_ShapeEnum aType;
@ -289,14 +295,14 @@ void TreatCompound(const TopoDS_Shape& aC1,
// //
aItC.Initialize(aC); aItC.Initialize(aC);
for (; aItC.More(); aItC.Next()) { for (; aItC.More(); aItC.Next()) {
const TopoDS_Shape& aS=aItC.Value(); const TopoDS_Shape& aS=aItC.Value();
aType=aS.ShapeType(); aType=aS.ShapeType();
if (aType==TopAbs_COMPOUND) { if (aType==TopAbs_COMPOUND) {
aLC1.Append(aS); aLC1.Append(aS);
} }
else { else {
aLSX.Append(aS); aLSX.Append(aS);
} }
} }
} }
// //