]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2961: Show selection of planes for sketcher on plane change
authorvsv <vsv@opencascade.com>
Thu, 22 Aug 2019 12:57:26 +0000 (15:57 +0300)
committervsv <vsv@opencascade.com>
Thu, 22 Aug 2019 12:57:26 +0000 (15:57 +0300)
src/PartSet/PartSet_WidgetSketchLabel.cpp

index 231c512fa895b2770608c9b24c5c84b1e9240fd0..221207f9d910ebb8b42d124d0f4ef273ca30a160 100644 (file)
@@ -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<ModelAPI_CompositeFeature>(myFeature);
     PartSet_Tools::nullifySketchPlane(aSketch);