]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make sub-group features presented correctly in he tree spo/xao_debug
authormpv <mpv@opencascade.com>
Tue, 21 Jun 2016 08:59:43 +0000 (11:59 +0300)
committermpv <mpv@opencascade.com>
Tue, 21 Jun 2016 08:59:43 +0000 (11:59 +0300)
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/Model/Model_Objects.cpp

index e212bf40de8229086faf74b59d0fdcac0bc90697..bdbbce4b49cb64d16f57b029df2a72d46f798e0c 100644 (file)
@@ -209,7 +209,7 @@ std::shared_ptr<ModelAPI_Feature> ExchangePlugin_ImportFeature::addFeature(
   if (aNew)
     data()->reflist(FEATURES_ID())->append(aNew);
   // set as current also after it becomes sub to set correctly enabled for other subs
-  document()->setCurrentFeature(aNew, false);
+  //document()->setCurrentFeature(aNew, false);
   return aNew;
 }
 
@@ -231,17 +231,12 @@ void ExchangePlugin_ImportFeature::removeFeature(
 
 int ExchangePlugin_ImportFeature::numberOfSubs(bool forTree) const
 {
-  if (forTree)
-    return 0;
   return data()->reflist(FEATURES_ID())->size(false);
 }
 
 std::shared_ptr<ModelAPI_Feature> ExchangePlugin_ImportFeature::subFeature(
     const int theIndex, bool forTree)
 {
-  if (forTree)
-    return FeaturePtr();
-
   ObjectPtr anObj = data()->reflist(FEATURES_ID())->object(theIndex, false);
   FeaturePtr aRes = std::dynamic_pointer_cast<ModelAPI_Feature>(anObj);
   return aRes;
index 2351c98354891f66baaa69fac77dc1580658c3e7..bafe2f8f8f23b8d7d096483ae316896245d6344b 100644 (file)
@@ -352,12 +352,14 @@ void Model_Objects::createHistory(const std::string& theGroupID)
         FeaturePtr aFeature = feature(aRefs->Value(a));
         if (aFeature.get()) {
           // if feature is in sub-component, remove it from history: it is in sub-tree of sub-component
-          if (!ModelAPI_Tools::compositeOwner(aFeature).get()) {
-            if (isFeature) { // here may be also disabled features
-              if (aFeature->isInHistory()) {
-                aResult.push_back(aFeature);
-              }
-            } else if (!aFeature->isDisabled()) { // iterate all results of not-disabled feature
+          bool isSub = ModelAPI_Tools::compositeOwner(aFeature).get() != NULL;
+          if (isFeature) { // here may be also disabled features
+            if (!isSub && aFeature->isInHistory()) {
+              aResult.push_back(aFeature);
+            }
+          } else if (!aFeature->isDisabled()) { // iterate all results of not-disabled feature
+            // construction results of sub-features should not be in the tree
+            if (!isSub || theGroupID != ModelAPI_ResultConstruction::group()) {
               // do not use reference to the list here since results can be changed by "isConcealed"
               const std::list<std::shared_ptr<ModelAPI_Result> > aResults = aFeature->results();
               std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();