1 // Copyright (C) 2016-20xx CEA/DEN, EDF R&D
3 // File: ExchangePlugin_Dump.h
4 // Created: August 1, 2016
5 // Author: Artem ZHIDKOV
7 #ifndef EXCHANGEPLUGIN_DUMP_H_
8 #define EXCHANGEPLUGIN_DUMP_H_
10 #include <ExchangePlugin.h>
12 #include <ModelAPI_Feature.h>
15 * \class ExchangePlugin_Dump
17 * \brief Store full model as a Python script
19 class ExchangePlugin_Dump : public ModelAPI_Feature
23 inline static const std::string& ID()
25 static const std::string MY_DUMP_ID("Dump");
28 /// attribute name of file path
29 inline static const std::string& FILE_PATH_ID()
31 static const std::string MY_FILE_PATH_ID("file_path");
32 return MY_FILE_PATH_ID;
34 /// attribute name of file format
35 inline static const std::string& FILE_FORMAT_ID()
37 static const std::string MY_FILE_FORMAT_ID("file_format");
38 return MY_FILE_FORMAT_ID;
41 /// Default constructor
42 EXCHANGEPLUGIN_EXPORT ExchangePlugin_Dump();
43 /// Default destructor
44 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_Dump();
46 /// Returns the unique kind of a feature
47 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind()
49 return ExchangePlugin_Dump::ID();
52 /// Request for initialization of data model of the feature: adding all attributes
53 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
55 /// Computes or recomputes the results
56 EXCHANGEPLUGIN_EXPORT virtual void execute();
58 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
59 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
61 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
62 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
65 /// Performs dump to the file
66 EXCHANGEPLUGIN_EXPORT void dump(const std::string& theFileName);