From: vsv Date: Fri, 27 Mar 2020 12:51:16 +0000 (+0300) Subject: Issue #18905(tuleap): Restore old plane of sketcher if user cancels plane change X-Git-Tag: V9_5_0a2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=84468a9b2264ea713ada76b0db9e685f24d02d5b;p=modules%2Fshaper.git Issue #18905(tuleap): Restore old plane of sketcher if user cancels plane change --- diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 577689a6c..099f6800b 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -332,6 +332,10 @@ bool PartSet_WidgetSketchLabel::setSelectionInternal( void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrsPtr& thePrs) { + // Nullify a temporary remembered plane + if (myTmpPlane.get()) + myTmpPlane.reset(); + GeomPlanePtr aPlane = plane(); if (!aPlane.get()) return; @@ -613,6 +617,11 @@ void PartSet_WidgetSketchLabel::onShowPanel() void PartSet_WidgetSketchLabel::deactivate() { + if (myTmpPlane.get()) { + setSketchPlane(myTmpPlane); + myTmpPlane.reset(); + } + ModuleBase_WidgetValidated::deactivate(); bool aHidePreview = myPreviewPlanes->isPreviewDisplayed(); myPreviewPlanes->erasePreviewPlanes(myWorkshop); @@ -774,6 +783,7 @@ void PartSet_WidgetSketchLabel::onChangePlane() } CompositeFeaturePtr aSketch = std::dynamic_pointer_cast(myFeature); + myTmpPlane = PartSet_Tools::sketchPlane(aSketch); PartSet_Tools::nullifySketchPlane(aSketch); Handle(SelectMgr_Filter) aFilter = aModule->selectionFilter(SF_SketchPlaneFilter); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.h b/src/PartSet/PartSet_WidgetSketchLabel.h index ba5c2bb50..64dbdb817 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.h +++ b/src/PartSet/PartSet_WidgetSketchLabel.h @@ -258,6 +258,8 @@ private: QDialog* myPartSetMessage; QDialog* mySizeMessage; + + GeomPlanePtr myTmpPlane; }; #endif