From 461d66b37ed8b29aa9834165c6ec84cd93933066 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 16 Aug 2016 11:55:27 +0300 Subject: [PATCH] Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_Shell --- src/BuildAPI/BuildAPI_Shell.cpp | 11 +++++++++++ src/BuildAPI/BuildAPI_Shell.h | 4 ++++ src/PythonAPI/model/build/__init__.py | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/BuildAPI/BuildAPI_Shell.cpp b/src/BuildAPI/BuildAPI_Shell.cpp index 86151b4cf..0e825e40e 100644 --- a/src/BuildAPI/BuildAPI_Shell.cpp +++ b/src/BuildAPI/BuildAPI_Shell.cpp @@ -6,6 +6,7 @@ #include "BuildAPI_Shell.h" +#include #include //================================================================================================== @@ -39,6 +40,16 @@ void BuildAPI_Shell::setBase(const std::list& theBaseObj execute(); } +//================================================================================================== +void BuildAPI_Shell::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + std::string aPartName = theDumper.name(aBase->document()); + + theDumper << aBase << " = model.addShell(" << aPartName << ", " + << aBase->selectionList(BuildPlugin_Shell::BASE_OBJECTS_ID()) << ")" << std::endl; +} + //================================================================================================== ShellPtr addShell(const std::shared_ptr& thePart, const std::list& theBaseObjects) diff --git a/src/BuildAPI/BuildAPI_Shell.h b/src/BuildAPI/BuildAPI_Shell.h index 3b7fbef19..0e6338842 100644 --- a/src/BuildAPI/BuildAPI_Shell.h +++ b/src/BuildAPI/BuildAPI_Shell.h @@ -41,6 +41,10 @@ public: /// Modify base attribute of the feature. BUILDAPI_EXPORT void setBase(const std::list& theBaseObjects); + + /// Dump wrapped feature + BUILDAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on Shell object. diff --git a/src/PythonAPI/model/build/__init__.py b/src/PythonAPI/model/build/__init__.py index e2cfdbb05..b8f7842f6 100644 --- a/src/PythonAPI/model/build/__init__.py +++ b/src/PythonAPI/model/build/__init__.py @@ -1,4 +1,4 @@ """Package for Build plugin for the Parametric Geometry API of the Modeler. """ -from BuildAPI import addVertex, addEdge, addFace +from BuildAPI import addVertex, addEdge, addFace, addShell -- 2.39.2