From 37413a32cddc90c3c1f375bf1a2be9a3cb430708 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 9 Oct 2017 14:47:54 +0300 Subject: [PATCH] Dump all features referred to the "Copy" feature when it is being dumped. --- src/ModelHighAPI/ModelHighAPI_Dumper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); + } + } } } -- 2.39.2