From: dbv Date: Tue, 16 Aug 2016 09:14:07 +0000 (+0300) Subject: Issue #1648: Dump Python in the High Level Parameterized Geometry API X-Git-Tag: V_2.5.0~137^2~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4a280319a8ed172bf46ddf85aded4db5052a738a;p=modules%2Fshaper.git Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for ExchangeAPI_Import --- diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index 0c2e7ff7d..87eb4410d 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -7,6 +7,7 @@ //-------------------------------------------------------------------------------------- #include "ExchangeAPI_Import.h" //-------------------------------------------------------------------------------------- +#include #include //-------------------------------------------------------------------------------------- ExchangeAPI_Import::ExchangeAPI_Import( @@ -38,6 +39,16 @@ void ExchangeAPI_Import::setFilePath(const std::string & theFilePath) execute(); } +//-------------------------------------------------------------------------------------- +void ExchangeAPI_Import::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + std::string aPartName = theDumper.name(aBase->document()); + + theDumper << aBase << " = model.addImport(" << aPartName << ", " + << aBase->string(ExchangePlugin_ImportFeature::FILE_PATH_ID()) << ")" << std::endl; +} + //-------------------------------------------------------------------------------------- ImportPtr addImport( const std::shared_ptr & thePart, diff --git a/src/ExchangeAPI/ExchangeAPI_Import.h b/src/ExchangeAPI/ExchangeAPI_Import.h index 015b374f3..7f55c7342 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.h +++ b/src/ExchangeAPI/ExchangeAPI_Import.h @@ -42,6 +42,10 @@ public: /// Set point values EXCHANGEAPI_EXPORT void setFilePath(const std::string & theFilePath); + + /// Dump wrapped feature + EXCHANGEAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; //! Pointer on Import object