mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-08 22:27:28 +05:00
22307: fix of source shape modification by Cut
This commit is contained in:
parent
a0f0eab960
commit
bdbb7196fa
@ -131,7 +131,14 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
|||||||
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aShape = performOperation (aShape1, aShape2, aType);
|
// Make a copy to prevent the original shape changes.
|
||||||
|
TopoDS_Shape aShapeCopy1;
|
||||||
|
TopoDS_Shape aShapeCopy2;
|
||||||
|
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
|
||||||
|
TNaming_CopyShape::CopyTool(aShape1, aMapTShapes, aShapeCopy1);
|
||||||
|
TNaming_CopyShape::CopyTool(aShape2, aMapTShapes, aShapeCopy2);
|
||||||
|
|
||||||
|
aShape = performOperation (aShapeCopy1, aShapeCopy2, aType);
|
||||||
|
|
||||||
if (aShape.IsNull())
|
if (aShape.IsNull())
|
||||||
return 0;
|
return 0;
|
||||||
@ -172,6 +179,14 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
|||||||
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Copy shape
|
||||||
|
TopoDS_Shape aShapeCopy;
|
||||||
|
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
|
||||||
|
|
||||||
|
TNaming_CopyShape::CopyTool(aShape, aMapTShapes, aShapeCopy);
|
||||||
|
aShape = aShapeCopy;
|
||||||
|
|
||||||
for (i = 2; i <= nbShapes; i++) {
|
for (i = 2; i <= nbShapes; i++) {
|
||||||
aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(i));
|
aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(i));
|
||||||
aShape2 = aRefShape->GetValue();
|
aShape2 = aRefShape->GetValue();
|
||||||
@ -190,7 +205,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
|||||||
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
aShape = performOperation (aShape, aShape2, aSimpleType);
|
// Copy shape
|
||||||
|
TNaming_CopyShape::CopyTool(aShape2, aMapTShapes, aShapeCopy);
|
||||||
|
aShape = performOperation (aShape, aShapeCopy, aSimpleType);
|
||||||
|
|
||||||
if (aShape.IsNull()) {
|
if (aShape.IsNull()) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -226,6 +243,12 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
|||||||
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
// Copy shape
|
||||||
|
TopoDS_Shape aShapeCopy;
|
||||||
|
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
|
||||||
|
|
||||||
|
TNaming_CopyShape::CopyTool(aShape, aMapTShapes, aShapeCopy);
|
||||||
|
aShape = aShapeCopy;
|
||||||
|
|
||||||
Handle(TColStd_HSequenceOfTransient) aTools = aCI.GetShapes();
|
Handle(TColStd_HSequenceOfTransient) aTools = aCI.GetShapes();
|
||||||
const Standard_Integer nbShapes = aTools->Length();
|
const Standard_Integer nbShapes = aTools->Length();
|
||||||
@ -252,7 +275,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aShape = performOperation (aShape, aTool, BOOLEAN_CUT);
|
// Copy shape
|
||||||
|
TNaming_CopyShape::CopyTool(aTool, aMapTShapes, aShapeCopy);
|
||||||
|
aShape = performOperation (aShape, aShapeCopy, BOOLEAN_CUT);
|
||||||
|
|
||||||
if (aShape.IsNull()) {
|
if (aShape.IsNull()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user