From af69a0211ff5e3f413e8c2a0862f05ccbe4ef298 Mon Sep 17 00:00:00 2001 From: azv Date: Fri, 17 Aug 2018 08:16:15 +0300 Subject: [PATCH] Dump with geometrical selection Dump selected construction elements like "Origin", coordinate axes and planes by their names only. --- src/ModelHighAPI/ModelHighAPI_Dumper.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index 496979d17..4e8152652 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -955,8 +955,19 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<( return *this; } + // how to dump selection: construction features are dumped by name always + bool isDumpByGeom = myGeometricalSelection; + if (isDumpByGeom) { + ResultPtr aRes = theAttrSelect->context(); + if (aRes) { + FeaturePtr aFeat = ModelAPI_Feature::feature(aRes->data()->owner()); + if (aFeat) + isDumpByGeom = aFeat->isInHistory(); + } + } + myDumpBuffer << "\"" << aShape->shapeTypeStr() << "\", "; - if (myGeometricalSelection) + if (isDumpByGeom) *this << aShape->middlePoint(); else myDumpBuffer << "\"" << theAttrSelect->namingName() << "\""; -- 2.39.2