]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2144: Workaround for the bug consists in clearing of presentations on removal...
authorvsv <vsv@opencascade.com>
Fri, 28 Apr 2017 13:35:47 +0000 (16:35 +0300)
committervsv <vsv@opencascade.com>
Fri, 28 Apr 2017 13:35:47 +0000 (16:35 +0300)
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp

index 195547813051ee8d14c72f79378c289924f763fa..005bf4cbc6a6b878c861b22d627f174a54b65842 100644 (file)
@@ -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<GeomAPI_Shape>& theS
                                       const Handle(Prs3d_Presentation)& thePrs,
                                       Quantity_Color theColor) const
 {
+  int aColNam = theColor.Name();
+  cout<<"### SketcherPrs_SymbolPrs::drawShape "<<theColor.Name()<<endl;
   Handle(Graphic3d_AspectLine3d) aLineAspect =
     new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);