From 6c9e2ba7a5d4e34759234855ee5ecff6e339d631 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 22 Aug 2019 15:57:26 +0300 Subject: [PATCH] Issue #2961: Show selection of planes for sketcher on plane change --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 231c512fa..221207f9d 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -539,6 +539,12 @@ void PartSet_WidgetSketchLabel::deactivate() if (aHidePreview) myWorkshop->viewer()->update(); + + if (myOpenTransaction) { + SessionPtr aMgr = ModelAPI_Session::get(); + aMgr->finishOperation(); + myOpenTransaction = false; + } } void PartSet_WidgetSketchLabel::selectionModes(int& theModuleSelectionModes, QIntList& theModes) @@ -680,6 +686,13 @@ void PartSet_WidgetSketchLabel::onChangePlane() myRemoveExternal->setVisible(true); myStackWidget->setCurrentIndex(0); + bool aBodyIsVisualized = myPreviewPlanes->hasVisualizedBodies(myWorkshop); + + if (!aBodyIsVisualized) { + // We have to select a plane before any operation + myPreviewPlanes->showPreviewPlanes(myWorkshop); + } + CompositeFeaturePtr aSketch = std::dynamic_pointer_cast(myFeature); PartSet_Tools::nullifySketchPlane(aSketch); -- 2.30.2