]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Extrusion Cut: the current extrusion cut feature should be restored after sketch...
authornds <nds@opencascade.com>
Thu, 17 Sep 2015 10:00:59 +0000 (13:00 +0300)
committernds <nds@opencascade.com>
Thu, 17 Sep 2015 10:01:39 +0000 (13:01 +0300)
src/PartSet/PartSet_WidgetSketchCreator.cpp

index 34762063035f07a42ddf357d035d7845ab6a4564..4a90a591f741882a50a1d665fff13eb7d5dc299f 100644 (file)
@@ -127,8 +127,17 @@ void PartSet_WidgetSketchCreator::onStarted()
     // Launch Sketch operation
     CompositeFeaturePtr aCompFeature = 
       std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
+
+    /// add sketch feature without current feature change.
+    /// it is important to do not change the current feature in order to
+    /// after sketch edition, the extrusion cut feature becomes current
+    SessionPtr aMgr = ModelAPI_Session::get();
+    DocumentPtr aDoc = aMgr->activeDocument();
+    FeaturePtr aPreviousCurrentFeature = aDoc->currentFeature(false);
     FeaturePtr aSketch = aCompFeature->addFeature("Sketch");
+    aDoc->setCurrentFeature(aPreviousCurrentFeature, false);
 
+    // start edit operation for the sketch
     ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
                                                              (myModule->createOperation("Sketch"));
     if (aFOperation)