From 399b8cd0e06149b1de0ca75dec1a6c90ac87bc8c Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 28 Apr 2017 16:35:47 +0300 Subject: [PATCH] Issue #2144: Workaround for the bug consists in clearing of presentations on removal of the constraint object --- src/SketcherPrs/SketcherPrs_SymbolPrs.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 195547813..005bf4cbc 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -115,6 +115,23 @@ SketcherPrs_SymbolPrs::~SketcherPrs_SymbolPrs() SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get(); // Empty memory in position manager aMgr->deleteConstraint(this); + + Handle(Prs3d_Presentation) aSelPrs = + GetSelectPresentation(Handle(PrsMgr_PresentationManager3d)()); + if (!aSelPrs.IsNull()) { + if (!aSelPrs->Groups().IsEmpty()) { + aSelPrs->Clear(); + } + aSelPrs->Erase(); + } + Handle(Prs3d_Presentation) aHilightPrs = + GetHilightPresentation(Handle(PrsMgr_PresentationManager3d)()); + if (!aHilightPrs.IsNull()) { + if (!aHilightPrs->Groups().IsEmpty()) { + aHilightPrs->Clear(); + } + aHilightPrs->Erase(); + } } #ifdef _WINDOWS @@ -313,6 +330,8 @@ void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr& theS const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { + int aColNam = theColor.Name(); + cout<<"### SketcherPrs_SymbolPrs::drawShape "<