]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesAPI/FeaturesAPI_Intersection.cpp
Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Intersection.cpp
index ce33f83da978172674e9eff8172225db1796112b..8cd80eb47e5985b86fdb0f3c1461099d9a8d9d33 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "FeaturesAPI_Intersection.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -51,6 +52,19 @@ void FeaturesAPI_Intersection::setTools(const std::list<ModelHighAPI_Selection>&
   execute();
 }
 
+//==================================================================================================
+void FeaturesAPI_Intersection::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  const std::string& aDocName = theDumper.name(aBase->document());
+
+  AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
+  AttributeSelectionListPtr anAttrTools = aBase->selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
+
+  theDumper << aBase << " = model.addIntersection(" << aDocName << ", "
+            << anAttrObjects << ", " << anAttrTools << ")" << std::endl;
+}
+
 //==================================================================================================
 IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& thePart,
                                 const std::list<ModelHighAPI_Selection>& theObjects,