Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_Operation.cpp
index 3b799f6689042bbb207297df4e76c9eaf8ec0732..bfe58446d370168a50092075ea228460c6ca7c25 100644 (file)
@@ -66,6 +66,8 @@ bool ModuleBase_Operation::isValid() const
 {
   if (!myFeature)
     return true; // rename operation
+  if (myFeature->isAction())
+    return true;
   //Get validators for the Id
   SessionPtr aMgr = ModelAPI_Session::get();
   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
@@ -131,20 +133,6 @@ bool ModuleBase_Operation::hasObject(ObjectPtr theObj) const
       if (theObj == (*aIt))
         return true;
     }
-    CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
-    if (aCompFeature.get() != NULL) {
-      for (int i = 0; i < aCompFeature->numberOfSubs(); i++) {
-        FeaturePtr aSubFeature = aCompFeature->subFeature(i);
-        std::list<ResultPtr> aResults = aSubFeature->results();
-        std::list<ResultPtr>::const_iterator aIt;
-        for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
-          if (theObj == (*aIt))
-            return true;
-        }
-        if (aSubFeature == theObj)
-          return true;
-      }
-    }
   }
   return false;
 }
@@ -158,7 +146,8 @@ std::shared_ptr<ModelAPI_Document> ModuleBase_Operation::document() const
 
 void ModuleBase_Operation::start()
 {
-  ModelAPI_Session::get()->startOperation();
+  QString anId = getDescription()->operationId();
+  ModelAPI_Session::get()->startOperation(anId.toStdString());
 
   if (!myIsEditing)
     createFeature();