]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make sketch edges appeared on sketch edit
authormpv <mpv@opencascade.com>
Thu, 21 May 2015 14:59:26 +0000 (17:59 +0300)
committermpv <mpv@opencascade.com>
Thu, 21 May 2015 14:59:26 +0000 (17:59 +0300)
src/Model/Model_Document.cpp

index 82ae16d6520b8e50cb5634d48785e26b7f9f8bc7..985c401ae47e5315ce5309ad93bcad9a955e1e8f 100644 (file)
@@ -669,15 +669,18 @@ void Model_Document::setCurrentFeature(std::shared_ptr<ModelAPI_Feature> theCurr
         }
       }
     }*/
-    // if feature nests into compisite feature, make the composite feature as current
-    const std::set<AttributePtr>& aRefsToMe = theCurrent->data()->refsToMe();
-    std::set<AttributePtr>::const_iterator aRefToMe = aRefsToMe.begin();
-    for(; aRefToMe != aRefsToMe.end(); aRefToMe++) {
-      CompositeFeaturePtr aComposite = 
-        std::dynamic_pointer_cast<ModelAPI_CompositeFeature>((*aRefToMe)->owner());
-      if (aComposite.get() && aComposite->isSub(theCurrent)) {
-        aMain = aComposite;
-        break;
+    aMain = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theCurrent);
+    if (!aMain.get()) {
+      // if feature nests into compisite feature, make the composite feature as current
+      const std::set<AttributePtr>& aRefsToMe = theCurrent->data()->refsToMe();
+      std::set<AttributePtr>::const_iterator aRefToMe = aRefsToMe.begin();
+      for(; aRefToMe != aRefsToMe.end(); aRefToMe++) {
+        CompositeFeaturePtr aComposite = 
+          std::dynamic_pointer_cast<ModelAPI_CompositeFeature>((*aRefToMe)->owner());
+        if (aComposite.get() && aComposite->isSub(theCurrent)) {
+          aMain = aComposite;
+          break;
+        }
       }
     }