]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Dump with geometrical selection
authorazv <azv@opencascade.com>
Fri, 17 Aug 2018 05:16:15 +0000 (08:16 +0300)
committerazv <azv@opencascade.com>
Thu, 30 Aug 2018 08:39:18 +0000 (11:39 +0300)
Dump selected construction elements like "Origin", coordinate axes and planes by their names only.

src/ModelHighAPI/ModelHighAPI_Dumper.cpp

index 496979d17a570efb8a9f60136597a63e4a0df180..4e8152652e97d431f321e6357aff20f00a3c1de8 100644 (file)
@@ -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() << "\"";