From b1d8487844112a655fe6d9738641c2358e91a2cb Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 22 Mar 2016 17:20:06 +0300 Subject: [PATCH 1/1] Issue #1343 Improvement of Extrusion and Revolution operations: preview planes should be erased by operation abort. --- src/PartSet/PartSet_WidgetSketchCreator.cpp | 17 +++++++++++++++-- src/PartSet/PartSet_WidgetSketchCreator.h | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 52e518297..bd70b0f0a 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -140,7 +140,7 @@ void PartSet_WidgetSketchCreator::setVisibleSelectionControl(const bool theSelec } } else { bool aHidePreview = myPreviewPlanes->isPreviewDisplayed(); - myPreviewPlanes->showPreviewPlanes(myWorkshop); + myPreviewPlanes->erasePreviewPlanes(myWorkshop); if (aHidePreview) aWorkshop->viewer()->update(); } @@ -262,7 +262,9 @@ bool PartSet_WidgetSketchCreator::focusTo() // we need to call activate here as the widget has no focus accepted controls // if these controls are added here, activate will happens automatically after focusIn() - activateCustom(); + XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myModule->workshop()); + XGUI_PropertyPanel* aPanel = aWorkshop->propertyPanel(); + aPanel->activateWidget(this, false); return true; } else { @@ -281,6 +283,17 @@ bool PartSet_WidgetSketchCreator::focusTo() return false; } +void PartSet_WidgetSketchCreator::deactivate() +{ + ModuleBase_WidgetSelector::deactivate(); + + bool aHidePreview = myPreviewPlanes->isPreviewDisplayed(); + myPreviewPlanes->erasePreviewPlanes(myWorkshop); + if (aHidePreview) + XGUI_Tools::workshop(myWorkshop)->viewer()->update(); + +} + void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp) { CompositeFeaturePtr aCompFeature = diff --git a/src/PartSet/PartSet_WidgetSketchCreator.h b/src/PartSet/PartSet_WidgetSketchCreator.h index 011608ef0..e0e6276e5 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.h +++ b/src/PartSet/PartSet_WidgetSketchCreator.h @@ -47,6 +47,9 @@ public: /// \return the state whether the widget can accept the focus virtual bool focusTo(); + /// The methiod called when widget is deactivated + virtual void deactivate(); + /// Editing mode depends on mode of current operation. This value is defined by it. virtual void setEditingMode(bool isEditing); -- 2.30.2