From: azv Date: Fri, 17 Aug 2018 05:16:15 +0000 (+0300) Subject: Dump with geometrical selection X-Git-Tag: V9_2_0a1~88 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=af69a0211ff5e3f413e8c2a0862f05ccbe4ef298;p=modules%2Fshaper.git Dump with geometrical selection Dump selected construction elements like "Origin", coordinate axes and planes by their names only. --- 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() << "\"";