1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef EXCHANGEPLUGIN_DUMP_H_
22 #define EXCHANGEPLUGIN_DUMP_H_
24 #include <ExchangePlugin.h>
26 #include <ModelAPI_Feature.h>
29 * \class ExchangePlugin_Dump
31 * \brief Store full model as a Python script
33 class ExchangePlugin_Dump : public ModelAPI_Feature
37 inline static const std::string& ID()
39 static const std::string MY_DUMP_ID("Dump");
42 /// attribute name of file path
43 inline static const std::string& FILE_PATH_ID()
45 static const std::string MY_FILE_PATH_ID("file_path");
46 return MY_FILE_PATH_ID;
48 /// attribute name of file format
49 inline static const std::string& FILE_FORMAT_ID()
51 static const std::string MY_FILE_FORMAT_ID("file_format");
52 return MY_FILE_FORMAT_ID;
55 /// Default constructor
56 EXCHANGEPLUGIN_EXPORT ExchangePlugin_Dump();
57 /// Default destructor
58 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_Dump();
60 /// Returns the unique kind of a feature
61 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind()
63 return ExchangePlugin_Dump::ID();
66 /// Request for initialization of data model of the feature: adding all attributes
67 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
69 /// Computes or recomputes the results
70 EXCHANGEPLUGIN_EXPORT virtual void execute();
72 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
73 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
75 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
76 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
79 /// Performs dump to the file
80 EXCHANGEPLUGIN_EXPORT void dump(const std::string& theFileName);