]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Dump all features referred to the "Copy" feature when it is being dumped.
authorazv <azv@opencascade.com>
Mon, 9 Oct 2017 11:47:54 +0000 (14:47 +0300)
committerazv <azv@opencascade.com>
Mon, 9 Oct 2017 11:48:21 +0000 (14:48 +0300)
src/ModelHighAPI/ModelHighAPI_Dumper.cpp

index 45fbe66f54e01aea1a22cb5198c0553dc82392b8..c005e37f024c72b879ab113212078447dcae4955 100644 (file)
@@ -963,6 +963,19 @@ ModelHighAPI_Dumper& operator<<(ModelHighAPI_Dumper& theDumper,
     else {
       FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anIt);
       theDumper.dumpFeature(aFeature, true);
+      // dump all referred features for the "Copy"
+      AttributeBooleanPtr aCopyAttr = aFeature->boolean("Copy");
+      if (aCopyAttr.get() && aCopyAttr->value())
+      {
+        const std::set<AttributePtr>& aRefs = aFeature->data()->refsToMe();
+        std::set<AttributePtr>::iterator aRefIt = aRefs.begin();
+        for (; aRefIt != aRefs.end(); ++aRefIt)
+        {
+          FeaturePtr anOwner = ModelAPI_Feature::feature((*aRefIt)->owner());
+          if (anOwner && !theDumper.isDumped(anOwner))
+            theDumper.dumpFeature(anOwner, true);
+        }
+      }
     }
   }