From: jfa Date: Wed, 20 Apr 2022 16:27:32 +0000 (+0300) Subject: [bos #29085] EDF 24794 - problem of visibility of sketch plane X-Git-Tag: V9_9_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7c9df2bf1dc8f95b5c4919aba1bc8848b06a136d;p=modules%2Fshaper.git [bos #29085] EDF 24794 - problem of visibility of sketch plane --- diff --git a/src/PartSet/PartSet_PreviewSketchPlane.cpp b/src/PartSet/PartSet_PreviewSketchPlane.cpp index d3c11e51a..c32085d4f 100644 --- a/src/PartSet/PartSet_PreviewSketchPlane.cpp +++ b/src/PartSet/PartSet_PreviewSketchPlane.cpp @@ -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(); - myShape = std::shared_ptr(); - } myPreviewIsDisplayed = false; } + if (isClearPlane) clearPlanePreview(); } void PartSet_PreviewSketchPlane::displaySketchPlane(ModuleBase_IWorkshop* theWorkshop) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index de6dce00b..f834c4c98 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -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(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)));