]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix #2530 Export Feature stored into the History
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 19 Jun 2018 07:09:13 +0000 (09:09 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 19 Jun 2018 07:09:13 +0000 (09:09 +0200)
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.h

index 407887dbce81cf2c0a194d64600a48fc6501dcb0..8803b3d3cb9fa1cf64b9b9772d07800ecdaf6dcd 100644 (file)
@@ -225,6 +225,9 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
   std::string anAuthor = string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())->value();
   aXao.setAuthor(anAuthor);
 
+  if (anAuthor == "automatic_shaper_export_to_XAO")
+    _comes_from_export_to_geom = true;
+
   // make shape for export from all results
   std::list<GeomShapePtr> aShapes;
   std::list<ResultBodyPtr> aResults;
index f0866181c1e63d5c22a2b05ae1f5965a91a4419f..317c10858ccac3ade5e5a1b887c3d745378a0d6b 100644 (file)
@@ -105,9 +105,10 @@ public:
   /// Computes or recomputes the results
   EXCHANGEPLUGIN_EXPORT virtual void execute();
 
-  /// Reimplemented from ModelAPI_Feature::isMacro(). Returns false.
-  // Not a macro. Otherwise, the feature will be deleted after being executed
-  EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return false; }
+  /// Reimplemented from ModelAPI_Feature::isMacro().
+  // Not always a macro. Otherwise, the feature will be deleted after being executed.
+  // It is needed for python dump of exportToXAO when it comes from exportToGEOM.
+  EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return !_comes_from_export_to_geom; }
 
   /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
   EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
@@ -123,6 +124,9 @@ protected:
 
   /// Performs export to XAO file
   EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string& theFileName);
+
+private:
+  bool _comes_from_export_to_geom = false;
 };
 
 #endif /* EXPORT_EXPORTFEATURE_H_ */