]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[bos #29085] EDF 24794 - problem of visibility of sketch plane V9_9_0b1
authorjfa <jfa@opencascade.com>
Wed, 20 Apr 2022 16:27:32 +0000 (19:27 +0300)
committerjfa <jfa@opencascade.com>
Wed, 20 Apr 2022 16:27:32 +0000 (19:27 +0300)
src/PartSet/PartSet_PreviewSketchPlane.cpp
src/PartSet/PartSet_WidgetSketchLabel.cpp

index d3c11e51a38e04dbeb0686d779b4d144f8667d79..c32085d4fa0b92b726b4747569970f3321a9dc21 100644 (file)
@@ -53,12 +53,9 @@ void PartSet_PreviewSketchPlane::eraseSketchPlane(ModuleBase_IWorkshop* theWorks
   if (myPreviewIsDisplayed) {
     XGUI_Displayer* aDisp = XGUI_Tools::workshop(theWorkshop)->displayer();
     aDisp->eraseAIS(myPlane, false);
-    if (isClearPlane) {
-      myPlane = std::shared_ptr<GeomAPI_AISObject>();
-      myShape = std::shared_ptr<GeomAPI_Shape>();
-    }
     myPreviewIsDisplayed = false;
   }
+  if (isClearPlane) clearPlanePreview();
 }
 
 void PartSet_PreviewSketchPlane::displaySketchPlane(ModuleBase_IWorkshop* theWorkshop)
index de6dce00b14a10d932ec96b24d25f0cbbfb23ec0..f834c4c98d2b6b970f8cfd91714496760eec3f00 100644 (file)
@@ -166,8 +166,17 @@ myIsSelection(false)
   myViewInverted = new QCheckBox(tr("Reversed"), aViewBox);
   aViewLayout->addWidget(myViewInverted, 0, 0);
 
+  // Sketch plane visibility
   myViewVisible = new QCheckBox(tr("Visible"), aViewBox);
-  myViewVisible->setChecked(true);
+  PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
+  PartSet_PreviewSketchPlane* aPreviewPlane = aModule->sketchMgr()->previewSketchPlane();
+  if (aPreviewPlane->isPlaneCreated())
+    // init with current state
+    myViewVisible->setChecked(aPreviewPlane->isDisplayed());
+  else
+    // true by default (at start of sketch creation)
+    myViewVisible->setChecked(true);
+
   aViewLayout->addWidget(myViewVisible, 0, 1, Qt::AlignRight);
   connect(myViewVisible, SIGNAL(toggled(bool)), this, SLOT(onShowViewPlane(bool)));