]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make sketch is not disabled after removing of Parameter in Parameters feature and...
authormpv <mikhail.ponikarov@opencascade.com>
Fri, 22 Apr 2016 12:43:28 +0000 (15:43 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Fri, 22 Apr 2016 12:43:28 +0000 (15:43 +0300)
src/Model/Model_Document.cpp

index 2c4bb4bd8068ba34c7749dae169269171483ef20..9836570f0859b53135125f8fd8915086bfa7f90c 100755 (executable)
@@ -945,6 +945,7 @@ void Model_Document::setCurrentFeature(
     }
   }
 
+  /*
   if (theVisible) { // make features below which are not in history also enabled: sketch subs
     FeaturePtr aNext = 
       theCurrent.get() ? myObjs->nextFeature(theCurrent) : myObjs->firstFeature();
@@ -955,7 +956,7 @@ void Model_Document::setCurrentFeature(
         theCurrent = aNext;
       }
     }
-  }
+  }*/
   if (theCurrent.get()) {
     std::shared_ptr<Model_Data> aData = std::static_pointer_cast<Model_Data>(theCurrent->data());
     if (!aData.get() || !aData->isValid()) {
@@ -1036,6 +1037,12 @@ void Model_Document::setCurrentFeatureUp()
   FeaturePtr aCurrent = currentFeature(false);
   if (aCurrent.get()) { // if not, do nothing because null is the upper
     FeaturePtr aPrev = myObjs->nextFeature(aCurrent, true);
+    // make the higher level composite as current (sketch becomes disabled if line is enabled)
+    if (aPrev.get()) {
+      for(FeaturePtr aComp = ModelAPI_Tools::compositeOwner(aPrev); aComp.get();
+        aComp = ModelAPI_Tools::compositeOwner(aPrev))
+          aPrev = aComp;
+    }
     // do not flush: it is called only on remove, it will be flushed in the end of transaction
     setCurrentFeature(aPrev, false);
   }