From: azv Date: Mon, 9 Oct 2017 11:47:54 +0000 (+0300) Subject: Dump all features referred to the "Copy" feature when it is being dumped. X-Git-Tag: V_2.9.0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37413a32cddc90c3c1f375bf1a2be9a3cb430708;p=modules%2Fshaper.git Dump all features referred to the "Copy" feature when it is being dumped. --- diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index 45fbe66f5..c005e37f0 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -963,6 +963,19 @@ ModelHighAPI_Dumper& operator<<(ModelHighAPI_Dumper& theDumper, else { FeaturePtr aFeature = std::dynamic_pointer_cast(*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& aRefs = aFeature->data()->refsToMe(); + std::set::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); + } + } } }