mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
fix for test cases bugs_13/N8 and imps_04/E5
This commit is contained in:
parent
48589cb055
commit
bcf1da3d82
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user