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)
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)));