]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Apply the history propagation also for the sketch results.
authormpv <mpv@opencascade.com>
Thu, 14 Dec 2017 14:25:22 +0000 (17:25 +0300)
committermpv <mpv@opencascade.com>
Thu, 14 Dec 2017 14:25:22 +0000 (17:25 +0300)
src/Model/Model_AttributeSelection.cpp

index 5c35d4b9cefc669cf681b6bc783d97cfc296a152..916e933280dfb49290fa517130868785f85f2863 100644 (file)
@@ -864,36 +864,36 @@ void Model_AttributeSelection::selectSubShape(
             }
           }
         }
-        // try to find the latest active result that must be used instead of the selected
-        // to set the active context (like in GUI selection), not concealed one
-        bool aFindNewContext = true;
-        while(aFindNewContext && aCont.get() && aShapeToBeSelected.get()) {
-          aFindNewContext = false;
-          const std::set<AttributePtr>& aRefs = aCont->data()->refsToMe();
-          std::set<AttributePtr>::const_iterator aRef = aRefs.begin();
-          for(; !aFindNewContext && aRef != aRefs.end(); aRef++) {
-            if (!aRef->get() || !(*aRef)->owner().get())
-              continue;
-            // concealed attribute only
-            FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
-            if (!ModelAPI_Session::get()->validators()->isConcealed(
-                    aRefFeat->getKind(), (*aRef)->id()))
+      }
+      // try to find the latest active result that must be used instead of the selected
+      // to set the active context (like in GUI selection), not concealed one
+      bool aFindNewContext = true;
+      while(aFindNewContext && aCont.get() && aShapeToBeSelected.get()) {
+        aFindNewContext = false;
+        const std::set<AttributePtr>& aRefs = aCont->data()->refsToMe();
+        std::set<AttributePtr>::const_iterator aRef = aRefs.begin();
+        for(; !aFindNewContext && aRef != aRefs.end(); aRef++) {
+          if (!aRef->get() || !(*aRef)->owner().get())
+            continue;
+          // concealed attribute only
+          FeaturePtr aRefFeat = std::dynamic_pointer_cast<ModelAPI_Feature>((*aRef)->owner());
+          if (!ModelAPI_Session::get()->validators()->isConcealed(
+                  aRefFeat->getKind(), (*aRef)->id()))
+            continue;
+          // search the feature result that contains sub-shape selected
+          std::list<std::shared_ptr<ModelAPI_Result> > aResults;
+          ModelAPI_Tools::allResults(aRefFeat, aResults);
+          std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = aResults.begin();
+          for(; aResIter != aResults.end(); aResIter++) {
+            if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled())
               continue;
-            // search the feature result that contains sub-shape selected
-            std::list<std::shared_ptr<ModelAPI_Result> > aResults;
-            ModelAPI_Tools::allResults(aRefFeat, aResults);
-            std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = aResults.begin();
-            for(; aResIter != aResults.end(); aResIter++) {
-              if (!aResIter->get() || !(*aResIter)->data()->isValid() || (*aResIter)->isDisabled())
-                continue;
-              GeomShapePtr aShape = (*aResIter)->shape();
-              if (aShape.get() && aShape->isSubShape(aShapeToBeSelected, false)) {
-                aCont = *aResIter; // found new context (produced from this) with same subshape
-                //if (!aShape->isSubShape(aShapeToBeSelected, true)) // take context orientation
-                //  aShapeToBeSelected->setOrientation();
-                aFindNewContext = true; // continue searching futher
-                break;
-              }
+            GeomShapePtr aShape = (*aResIter)->shape();
+            if (aShape.get() && aShape->isSubShape(aShapeToBeSelected, false)) {
+              aCont = *aResIter; // found new context (produced from this) with same subshape
+              //if (!aShape->isSubShape(aShapeToBeSelected, true)) // take context orientation
+              //  aShapeToBeSelected->setOrientation();
+              aFindNewContext = true; // continue searching futher
+              break;
             }
           }
         }