From: kgv Date: Mon, 23 Nov 2020 14:58:01 +0000 (+0300) Subject: 0031955: Visualization - Graphic3d_CView::Erase() should always remove structure... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=1abdd41c29b3e48fbcb4ab59fd5e2e4e3ec89c14;p=occt-copy.git 0031955: Visualization - Graphic3d_CView::Erase() should always remove structure from myStructsToCompute [OCCT 7.2.0 backport] --- diff --git a/src/Graphic3d/Graphic3d_CView.cxx b/src/Graphic3d/Graphic3d_CView.cxx index 2a0e8032ac..24f64919ad 100644 --- a/src/Graphic3d/Graphic3d_CView.cxx +++ b/src/Graphic3d/Graphic3d_CView.cxx @@ -847,24 +847,23 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure) return; } - Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (theStructure->Visual()); - if (!ComputedMode()) - { - anAnswer = Graphic3d_TOA_YES; - } - + const Graphic3d_TypeOfAnswer anAnswer = myIsInComputedMode ? acceptDisplay (theStructure->Visual()) : Graphic3d_TOA_YES; if (anAnswer != Graphic3d_TOA_COMPUTE) { 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 (anIndex != 0) + if (anAnswer == Graphic3d_TOA_COMPUTE + && myIsInComputedMode) { const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex); eraseStructure (aCompStruct->CStructure()); } + myStructsComputed .Remove (anIndex); + myStructsToCompute.Remove (anIndex); } myStructsDisplayed.Remove (theStructure); Update (theStructure->GetZLayer());