From 4781049be305fb7513bd7e7f59a3d660697f5783 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 16 Aug 2016 12:06:01 +0300 Subject: [PATCH] Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_Wire --- src/BuildAPI/BuildAPI_Wire.cpp | 11 +++++++++++ src/BuildAPI/BuildAPI_Wire.h | 4 ++++ src/PythonAPI/model/build/__init__.py | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/BuildAPI/BuildAPI_Wire.cpp b/src/BuildAPI/BuildAPI_Wire.cpp index 58a498954..124ba6838 100644 --- a/src/BuildAPI/BuildAPI_Wire.cpp +++ b/src/BuildAPI/BuildAPI_Wire.cpp @@ -6,6 +6,7 @@ #include "BuildAPI_Wire.h" +#include #include //================================================================================================== @@ -39,6 +40,16 @@ void BuildAPI_Wire::setBase(const std::list& theBaseObje execute(); } +//================================================================================================== +void BuildAPI_Wire::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + std::string aPartName = theDumper.name(aBase->document()); + + theDumper << aBase << " = model.addWire(" << aPartName << ", " + << aBase->selectionList(BuildPlugin_Wire::BASE_OBJECTS_ID()) << ")" << std::endl; +} + //================================================================================================== void BuildAPI_Wire::addContour() { diff --git a/src/BuildAPI/BuildAPI_Wire.h b/src/BuildAPI/BuildAPI_Wire.h index d1d24fa71..68430929e 100644 --- a/src/BuildAPI/BuildAPI_Wire.h +++ b/src/BuildAPI/BuildAPI_Wire.h @@ -45,6 +45,10 @@ public: /// Adds closed contour. BUILDAPI_EXPORT void addContour(); + + /// Dump wrapped feature + BUILDAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on Wire object. diff --git a/src/PythonAPI/model/build/__init__.py b/src/PythonAPI/model/build/__init__.py index 396bbe8fa..1556669bf 100644 --- a/src/PythonAPI/model/build/__init__.py +++ b/src/PythonAPI/model/build/__init__.py @@ -1,5 +1,5 @@ """Package for Build plugin for the Parametric Geometry API of the Modeler. """ -from BuildAPI import addVertex, addEdge, addFace, addShell +from BuildAPI import addVertex, addEdge, addWire, addFace, addShell from BuildAPI import addSubShapes -- 2.39.2