From: dbv Date: Tue, 16 Aug 2016 09:01:14 +0000 (+0300) Subject: Issue #1648: Dump Python in the High Level Parameterized Geometry API X-Git-Tag: V_2.5.0~137^2~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9fe08a865f40acb73d604636f48546394473df83;p=modules%2Fshaper.git Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_SubShapes --- diff --git a/src/BuildAPI/BuildAPI_SubShapes.cpp b/src/BuildAPI/BuildAPI_SubShapes.cpp index c4eaafb4f..21f23e839 100644 --- a/src/BuildAPI/BuildAPI_SubShapes.cpp +++ b/src/BuildAPI/BuildAPI_SubShapes.cpp @@ -6,6 +6,7 @@ #include "BuildAPI_SubShapes.h" +#include #include //================================================================================================== @@ -49,6 +50,17 @@ void BuildAPI_SubShapes::setSubShapes(const std::list& 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& thePart, const ModelHighAPI_Selection& theBaseShape, diff --git a/src/BuildAPI/BuildAPI_SubShapes.h b/src/BuildAPI/BuildAPI_SubShapes.h index b8108f5bf..492df6fdc 100644 --- a/src/BuildAPI/BuildAPI_SubShapes.h +++ b/src/BuildAPI/BuildAPI_SubShapes.h @@ -47,6 +47,10 @@ public: /// Modify sub-shapes attribute of the feature. BUILDAPI_EXPORT void setSubShapes(const std::list& theSubShapes); + + /// Dump wrapped feature + BUILDAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on SubShapes object. diff --git a/src/PythonAPI/model/build/__init__.py b/src/PythonAPI/model/build/__init__.py index b8f7842f6..396bbe8fa 100644 --- a/src/PythonAPI/model/build/__init__.py +++ b/src/PythonAPI/model/build/__init__.py @@ -2,3 +2,4 @@ """ from BuildAPI import addVertex, addEdge, addFace, addShell +from BuildAPI import addSubShapes