]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for generation of ExtrusionSketch preview while the nested sketch element is...
authormpv <mpv@opencascade.com>
Thu, 17 Sep 2015 10:51:28 +0000 (13:51 +0300)
committermpv <mpv@opencascade.com>
Thu, 17 Sep 2015 10:51:28 +0000 (13:51 +0300)
src/Model/Model_Update.cpp

index 417a3de14406f529e695faa5eaa87c1ae022a800..a9e9172152c301caa7c3a5fbbd3636d1978cef6e 100644 (file)
@@ -278,8 +278,13 @@ void Model_Update::updateFeature(FeaturePtr theFeature)
     return;
 
   // do not execute the composite that contains the current
-  //CompositeFeaturePtr aMain = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theFeature);
-  //bool isPostponedMain = aMain.get() && aMain->isSub(theFeature->document()->currentFeature(false));
+  bool isPostponedMain = false;
+  CompositeFeaturePtr aMain = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theFeature);
+  if (theFeature->getKind() == "ExtrusionSketch" && aMain.get()) {
+    CompositeFeaturePtr aCurrentOwner = 
+      ModelAPI_Tools::compositeOwner(theFeature->document()->currentFeature(false));
+    isPostponedMain = aCurrentOwner.get() && aMain->isSub(aCurrentOwner);
+  }
 
   #ifdef DEB_UPDATE
     std::cout<<"Update Feature "<<theFeature->name()<<std::endl;
@@ -360,12 +365,12 @@ void Model_Update::updateFeature(FeaturePtr theFeature)
     if (aJustUpdated) {
       ModelAPI_ExecState aState = theFeature->data()->execState();
       if (aFactory->validate(theFeature)) {
-        //if (!isPostponedMain) {
+        if (!isPostponedMain) {
           #ifdef DEB_UPDATE
             std::cout<<"Execute Feature "<<theFeature->name()<<std::endl;
           #endif
           executeFeature(theFeature);
-        //}
+        }
       } else {
         #ifdef DEB_UPDATE
           std::cout<<"Feature is not valid, erase results "<<theFeature->name()<<std::endl;