]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelHighAPI/ModelHighAPI_Dumper.cpp
Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Dumper.cpp
index 55cd9f2c7583fdd1e37b0e476daad817aeb60c92..5bd5df4a5113d24f6717c2c500c2923ee2408f61 100644 (file)
@@ -33,8 +33,6 @@
 
 #include <PartSetPlugin_Part.h>
 
-#include <SketchPlugin_SketchEntity.h>
-
 #include <OSD_OpenFile.hxx>
 
 #include <fstream>
@@ -192,16 +190,8 @@ bool ModelHighAPI_Dumper::process(const std::shared_ptr<ModelAPI_CompositeFeatur
     FeaturePtr aFeature = theComposite->subFeature(anIndex);
     if (isDumped(aFeature))
       continue;
-    bool isForce = true;
-    // check the feature is a sketch entity and a copy of another entity
-    std::shared_ptr<SketchPlugin_SketchEntity> aSketchEntity =
-        std::dynamic_pointer_cast<SketchPlugin_SketchEntity>(aFeature);
-    if (aSketchEntity && aSketchEntity->isCopy())
-      isForce = false;
-    dumpFeature(aFeature, isForce);
+    dumpFeature(aFeature, true);
   }
-  // dump empty line for appearance
-  myDumpBuffer << std::endl;
   return true;
 }
 
@@ -583,6 +573,10 @@ ModelHighAPI_Dumper& operator<<(ModelHighAPI_Dumper& theDumper,
       theDumper.process(aCompFeat);
   }
 
+  // avoid multiple empty lines
+  size_t anInd = std::string::npos;
+  while ((anInd = aBufCopy.find("\n\n\n")) != std::string::npos)
+    aBufCopy.erase(anInd, 1);
   // then store currently dumped string
   theDumper.myFullDump << aBufCopy;