From: dbv Date: Tue, 16 Aug 2016 08:48:47 +0000 (+0300) Subject: Issue #1648: Dump Python in the High Level Parameterized Geometry API X-Git-Tag: V_2.5.0~137^2~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ebed28a20e3dc3c6d0ea70493f148e1fd527426e;p=modules%2Fshaper.git Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for BuildAPI_Edge --- diff --git a/src/BuildAPI/BuildAPI_Edge.cpp b/src/BuildAPI/BuildAPI_Edge.cpp index a1a1a03df..09374b14d 100644 --- a/src/BuildAPI/BuildAPI_Edge.cpp +++ b/src/BuildAPI/BuildAPI_Edge.cpp @@ -6,6 +6,7 @@ #include "BuildAPI_Edge.h" +#include #include //================================================================================================== @@ -39,6 +40,16 @@ void BuildAPI_Edge::setBase(const std::list& theBaseObje execute(); } +//================================================================================================== +void BuildAPI_Edge::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + std::string aPartName = theDumper.name(aBase->document()); + + theDumper << aBase << " = model.addEdge(" << aPartName << ", " + << aBase->selectionList(BuildPlugin_Edge::BASE_OBJECTS_ID()) << ")" << std::endl; +} + //================================================================================================== EdgePtr addEdge(const std::shared_ptr& thePart, const std::list& theBaseObjects) diff --git a/src/BuildAPI/BuildAPI_Edge.h b/src/BuildAPI/BuildAPI_Edge.h index 6df02f745..2d9fe087e 100644 --- a/src/BuildAPI/BuildAPI_Edge.h +++ b/src/BuildAPI/BuildAPI_Edge.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 Edge object. diff --git a/src/PythonAPI/model/build/__init__.py b/src/PythonAPI/model/build/__init__.py index e700be81f..6f120ae6a 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 +from BuildAPI import addVertex, addEdge