]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1648: Dump Python in the High Level Parameterized Geometry API
authordbv <dbv@opencascade.com>
Tue, 16 Aug 2016 09:14:07 +0000 (12:14 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Aug 2016 09:14:07 +0000 (12:14 +0300)
Dump for ExchangeAPI_Import

src/ExchangeAPI/ExchangeAPI_Import.cpp
src/ExchangeAPI/ExchangeAPI_Import.h

index 0c2e7ff7d33fe4ebebaa1a58fe99693550f26a1f..87eb4410d0333815e83daeaf6147ba6921f94ac7 100644 (file)
@@ -7,6 +7,7 @@
 //--------------------------------------------------------------------------------------
 #include "ExchangeAPI_Import.h"
 //--------------------------------------------------------------------------------------
+#include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Tools.h>
 //--------------------------------------------------------------------------------------
 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<ModelAPI_Document> & thePart,
index 015b374f39803d697851d154d83c6096528755d6..7f55c7342470159db302555996d9c71e1f768134 100644 (file)
@@ -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