From 4a280319a8ed172bf46ddf85aded4db5052a738a Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 16 Aug 2016 12:14:07 +0300 Subject: [PATCH] Issue #1648: Dump Python in the High Level Parameterized Geometry API Dump for ExchangeAPI_Import --- src/ExchangeAPI/ExchangeAPI_Import.cpp | 11 +++++++++++ src/ExchangeAPI/ExchangeAPI_Import.h | 4 ++++ 2 files changed, 15 insertions(+) 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 -- 2.39.2