1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-31 11:15:31 +03:00

0031955: Visualization - Graphic3d_CView::Erase() should always remove structure from myStructsToCompute [OCCT 7.2.0 backport]

This commit is contained in:
kgv 2020-11-23 17:58:01 +03:00
parent 6a9e31de14
commit 1abdd41c29

View File

@ -847,24 +847,23 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
return; return;
} }
Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (theStructure->Visual()); const Graphic3d_TypeOfAnswer anAnswer = myIsInComputedMode ? acceptDisplay (theStructure->Visual()) : Graphic3d_TOA_YES;
if (!ComputedMode())
{
anAnswer = Graphic3d_TOA_YES;
}
if (anAnswer != Graphic3d_TOA_COMPUTE) if (anAnswer != Graphic3d_TOA_COMPUTE)
{ {
eraseStructure (theStructure->CStructure()); eraseStructure (theStructure->CStructure());
} }
else if (anAnswer == Graphic3d_TOA_COMPUTE && myIsInComputedMode)
const Standard_Integer anIndex = !myStructsToCompute.IsEmpty() ? IsComputed (theStructure) : 0;
if (anIndex != 0)
{ {
const Standard_Integer anIndex = IsComputed (theStructure); if (anAnswer == Graphic3d_TOA_COMPUTE
if (anIndex != 0) && myIsInComputedMode)
{ {
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex); const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex);
eraseStructure (aCompStruct->CStructure()); eraseStructure (aCompStruct->CStructure());
} }
myStructsComputed .Remove (anIndex);
myStructsToCompute.Remove (anIndex);
} }
myStructsDisplayed.Remove (theStructure); myStructsDisplayed.Remove (theStructure);
Update (theStructure->GetZLayer()); Update (theStructure->GetZLayer());