]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #360: fix of disappearance of sketch result because sub-results are not ready yet
authormpv <mpv@opencascade.com>
Wed, 21 Jan 2015 08:24:38 +0000 (11:24 +0300)
committermpv <mpv@opencascade.com>
Wed, 21 Jan 2015 08:24:38 +0000 (11:24 +0300)
src/Model/Model_Document.cpp

index 65d4cb70bb76d66c9d87d07d71f9dcbe82702e46..fb6ebf8e46e9605955054ab3b3d86ed55851fd5e 100644 (file)
@@ -14,6 +14,7 @@
 #include <Model_ResultBody.h>
 #include <Model_ResultGroup.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_CompositeFeature.h>
 #include <Events_Loop.h>
 #include <Events_Error.h>
 
@@ -844,14 +845,21 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated, const bool t
     }
   }
   // update results of thefeatures (after features created because they may be connected, like sketch and sub elements)
+  std::list<FeaturePtr> aComposites; // composites must be updated after their subs (issue 360)
   TDF_ChildIDIterator aLabIter2(featuresLabel(), TDataStd_Comment::GetID());
   for (; aLabIter2.More(); aLabIter2.Next()) {
     TDF_Label aFeatureLabel = aLabIter2.Value()->Label();
     if (myObjs.IsBound(aFeatureLabel)) {  // a new feature is inserted
       FeaturePtr aFeature = myObjs.Find(aFeatureLabel);
+      if (std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature).get())
+        aComposites.push_back(aFeature);
       updateResults(aFeature);
     }
   }
+  std::list<FeaturePtr>::iterator aComposite = aComposites.begin();
+  for(; aComposite != aComposites.end(); aComposite++) {
+    updateResults(*aComposite);
+  }
 
   // check all features are checked: if not => it was removed
   NCollection_DataMap<TDF_Label, FeaturePtr>::Iterator aFIter(myObjs);