From e4d6b1dd4f9e494bece0c16ca467c255247a62d6 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 16 Aug 2016 11:52:17 +0300 Subject: [PATCH] Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_Face --- src/BuildAPI/BuildAPI_Face.cpp | 11 +++++++++++ src/BuildAPI/BuildAPI_Face.h | 4 ++++ src/PythonAPI/model/build/__init__.py | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/BuildAPI/BuildAPI_Face.cpp b/src/BuildAPI/BuildAPI_Face.cpp index 3f5cf71df..54b731c84 100644 --- a/src/BuildAPI/BuildAPI_Face.cpp +++ b/src/BuildAPI/BuildAPI_Face.cpp @@ -6,6 +6,7 @@ #include "BuildAPI_Face.h" +#include #include //================================================================================================== @@ -39,6 +40,16 @@ void BuildAPI_Face::setBase(const std::list& theBaseObje execute(); } +//================================================================================================== +void BuildAPI_Face::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + std::string aPartName = theDumper.name(aBase->document()); + + theDumper << aBase << " = model.addFace(" << aPartName << ", " + << aBase->selectionList(BuildPlugin_Face::BASE_OBJECTS_ID()) << ")" << std::endl; +} + //================================================================================================== FacePtr addFace(const std::shared_ptr& thePart, const std::list& theBaseObjects) diff --git a/src/BuildAPI/BuildAPI_Face.h b/src/BuildAPI/BuildAPI_Face.h index 8a621790e..997499bbb 100644 --- a/src/BuildAPI/BuildAPI_Face.h +++ b/src/BuildAPI/BuildAPI_Face.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 Face object. diff --git a/src/PythonAPI/model/build/__init__.py b/src/PythonAPI/model/build/__init__.py index 6f120ae6a..e2cfdbb05 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 +from BuildAPI import addVertex, addEdge, addFace -- 2.39.2