From: dbv Date: Tue, 16 Aug 2016 09:06:01 +0000 (+0300) Subject: Issue #1648: Dump Python in the High Level Parameterized Geometry API X-Git-Tag: V_2.5.0~137^2~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4781049be305fb7513bd7e7f59a3d660697f5783;p=modules%2Fshaper.git Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_Wire --- 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