1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-09 18:50:54 +03:00

0033806: Shape Healing - ShapeCustom optimization while rebuilding compounds

Avoid double binding of shapes to context.
Take all changes into account by reshape
This commit is contained in:
oan 2024-08-26 19:39:42 +01:00 committed by dpasukhi
parent a52ee17c73
commit d0e33902bc

View File

@ -142,11 +142,7 @@ TopoDS_Shape ShapeCustom::ApplyModifier (const TopoDS_Shape &S,
res = ApplyModifier (shape, M, context, MD, aRange, aReShape); res = ApplyModifier (shape, M, context, MD, aRange, aReShape);
} }
if ( !res.IsSame (shape) ) locModified |= !res.IsSame (shape);
{
context.Bind (aShapeNoLoc, res.Located (TopLoc_Location()));
locModified = Standard_True;
}
B.Add (C, res); B.Add (C, res);
} }
@ -162,10 +158,18 @@ TopoDS_Shape ShapeCustom::ApplyModifier (const TopoDS_Shape &S,
return S; return S;
} }
context.Bind ( SF, C ); SF.Orientation (S.Orientation());
C .Orientation (S.Orientation());
context.Bind (SF, C);
C.Location (S.Location(), Standard_False);
if (!aReShape.IsNull())
{
aReShape->Replace (S, C);
}
C.Orientation (S.Orientation());
C.Location (S.Location(), Standard_False);
return C; return C;
} }
@ -175,12 +179,21 @@ TopoDS_Shape ShapeCustom::ApplyModifier (const TopoDS_Shape &S,
MD.Perform(M, aPS.Next()); MD.Perform(M, aPS.Next());
if ( !aPS.More() || !MD.IsDone() ) return S; if ( !aPS.More() || !MD.IsDone() ) return S;
TopoDS_Shape aResult = MD.ModifiedShape (SF);
aResult.Orientation (S.Orientation());
if (!SF.IsSame (aResult))
{
context.Bind (S.Located (TopLoc_Location()), aResult.Located (TopLoc_Location()));
}
if ( !aReShape.IsNull() ) if ( !aReShape.IsNull() )
{ {
UpdateShapeBuild ( SF, MD, aReShape ); UpdateShapeBuild ( SF, MD, aReShape );
} }
return MD.ModifiedShape(SF).Oriented(S.Orientation()); return aResult;
} }