X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetSketchLabel.cpp;h=54a8250ffa48340e52e0725b6c34df23700cce13;hb=4656ef7be2170488c06dbc0586f71348be93b5fb;hp=87c535a543d80ac764d185676fee0bdf7be421a7;hpb=d816b8052e799c31f98cad7d9203198ef42d93b3;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 87c535a54..54a8250ff 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -80,6 +80,10 @@ #include #include +#ifdef WIN32 +#pragma warning(disable : 4456) // for nested foreach +#endif + #ifndef DBL_MAX #define DBL_MAX 1.7976931348623158e+308 #endif @@ -162,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)));