]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
authordbv <dbv@opencascade.com>
Tue, 16 Aug 2016 09:01:14 +0000 (12:01 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Aug 2016 09:01:14 +0000 (12:01 +0300)
Dump for BuildAPI_SubShapes

src/BuildAPI/BuildAPI_SubShapes.cpp
src/BuildAPI/BuildAPI_SubShapes.h
src/PythonAPI/model/build/__init__.py

index c4eaafb4fe371bf6d79605ad12ead1eba6db4e52..21f23e83928e4787616ee7f716ee945f26f0392c 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "BuildAPI_SubShapes.h"
 
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 
 //==================================================================================================
@@ -49,6 +50,17 @@ void BuildAPI_SubShapes::setSubShapes(const std::list<ModelHighAPI_Selection>& t
   execute();
 }
 
+//==================================================================================================
+void BuildAPI_SubShapes::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+  std::string aPartName = theDumper.name(aBase->document());
+
+  theDumper << aBase << " = model.addSubShapes(" << aPartName << ", "
+            << aBase->selection(BuildPlugin_SubShapes::BASE_SHAPE_ID()) << ", "
+            << aBase->selectionList(BuildPlugin_SubShapes::SUBSHAPES_ID()) << ")" << std::endl;
+}
+
 //==================================================================================================
 SubShapesPtr addSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
                           const ModelHighAPI_Selection& theBaseShape,
index b8108f5bf730bd0b4b556d482c974bea9b78b816..492df6fdc4ed4ab4521e590b6b271b7fc27b6ee2 100644 (file)
@@ -47,6 +47,10 @@ public:
   /// Modify sub-shapes attribute of the feature.
   BUILDAPI_EXPORT
   void setSubShapes(const std::list<ModelHighAPI_Selection>& theSubShapes);
+
+  /// Dump wrapped feature
+  BUILDAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
 };
 
 /// Pointer on SubShapes object.
index b8f7842f6411425f418cafd60f003e6990bcf325..396bbe8fafab8c299c157451dd5b4422c814ac18 100644 (file)
@@ -2,3 +2,4 @@
 """
 
 from BuildAPI import addVertex, addEdge, addFace, addShell
+from BuildAPI import addSubShapes