]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_WidgetSketchCreator.cpp
Salome HOME
Providing Action class to have a common approach to start/finish/abort model transact...
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchCreator.cpp
index 20d602a3a69c37500683591fc5e08a04de078038..9781f9cf8ca1aabbc1c890ac32a006856162793d 100644 (file)
@@ -26,6 +26,7 @@
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_Operation.h>
 #include <ModuleBase_IPropertyPanel.h>
+#include <ModuleBase_OperationFeature.h>
 #include <Config_WidgetAPI.h>
 
 #include <QLabel>
@@ -118,9 +119,11 @@ void PartSet_WidgetSketchCreator::onStarted()
       std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
     FeaturePtr aSketch = aCompFeature->addFeature("Sketch");
 
-    ModuleBase_Operation* anOperation = myModule->createOperation("Sketch");
-    anOperation->setFeature(aSketch);
-    myModule->sendOperation(anOperation);
+    ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+                                                             (myModule->createOperation("Sketch"));
+    if (aFOperation)
+      aFOperation->setFeature(aSketch);
+    myModule->sendOperation(aFOperation);
     //connect(anOperation, SIGNAL(aborted()), aWorkshop->operationMgr(), SLOT(abortAllOperations()));
   } else {
     // Break current operation