fix for test cases bugs_13/N8 and imps_04/E5

This commit is contained in:
skv 2015-04-23 11:36:19 +03:00
parent 48589cb055
commit bcf1da3d82

View File

@ -548,71 +548,6 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
// BEGIN: Mantis issue 0021060: always limit tolerance of BOP result
// 1. Get shape parameters for comparison
int nbTypes [TopAbs_SHAPE];
{
for (int iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypes[iType] = 0;
nbTypes[aShape.ShapeType()]++;
TopTools_MapOfShape aMapOfShape;
aMapOfShape.Add(aShape);
TopTools_ListOfShape aListOfShape;
aListOfShape.Append(aShape);
TopTools_ListIteratorOfListOfShape itL (aListOfShape);
for (; itL.More(); itL.Next()) {
TopoDS_Iterator it (itL.Value());
for (; it.More(); it.Next()) {
TopoDS_Shape s = it.Value();
if (aMapOfShape.Add(s)) {
aListOfShape.Append(s);
nbTypes[s.ShapeType()]++;
}
}
}
}
// 2. Limit tolerance
TopoDS_Shape aShapeCopy;
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
TNaming_CopyShape::CopyTool(aShape, aMapTShapes, aShapeCopy);
if ( GEOMUtils::FixShapeTolerance(aShapeCopy, true) ) {
int iType, nbTypesCopy [TopAbs_SHAPE];
for (iType = 0; iType < TopAbs_SHAPE; ++iType)
nbTypesCopy[iType] = 0;
nbTypesCopy[aShapeCopy.ShapeType()]++;
TopTools_MapOfShape aMapOfShape;
aMapOfShape.Add(aShapeCopy);
TopTools_ListOfShape aListOfShape;
aListOfShape.Append(aShapeCopy);
TopTools_ListIteratorOfListOfShape itL (aListOfShape);
for (; itL.More(); itL.Next()) {
TopoDS_Iterator it (itL.Value());
for (; it.More(); it.Next()) {
TopoDS_Shape s = it.Value();
if (aMapOfShape.Add(s)) {
aListOfShape.Append(s);
nbTypesCopy[s.ShapeType()]++;
}
}
}
bool isEqual = true;
for (iType = 0; iType < TopAbs_SHAPE && isEqual; ++iType) {
if (nbTypes[iType] != nbTypesCopy[iType])
isEqual = false;
}
if (isEqual)
aShape = aShapeCopy;
}
// END: Mantis issue 0021060
return aShape;
}