From 9fe08a865f40acb73d604636f48546394473df83 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 16 Aug 2016 12:01:14 +0300 Subject: [PATCH] Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_SubShapes --- src/BuildAPI/BuildAPI_SubShapes.cpp | 12 ++++++++++++ src/BuildAPI/BuildAPI_SubShapes.h | 4 ++++ src/PythonAPI/model/build/__init__.py | 1 + 3 files changed, 17 insertions(+) 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 -- 2.39.2