1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #ifndef EXCHANGEPLUGIN_DUMP_H_
21 #define EXCHANGEPLUGIN_DUMP_H_
23 #include <ExchangePlugin.h>
25 #include <ModelAPI_Feature.h>
28 * \class ExchangePlugin_Dump
30 * \brief Store full model as a Python script
32 class ExchangePlugin_Dump : public ModelAPI_Feature
36 inline static const std::string& ID()
38 static const std::string MY_DUMP_ID("Dump");
41 /// attribute name of file path
42 inline static const std::string& FILE_PATH_ID()
44 static const std::string MY_FILE_PATH_ID("file_path");
45 return MY_FILE_PATH_ID;
47 /// attribute name of file format
48 inline static const std::string& FILE_FORMAT_ID()
50 static const std::string MY_FILE_FORMAT_ID("file_format");
51 return MY_FILE_FORMAT_ID;
54 /// attribute name of dumping by topological naming
55 inline static const std::string& TOPOLOGICAL_NAMING_DUMP_ID()
57 static const std::string MY_TOOPNAMING_DUMP_ID("topological_naming");
58 return MY_TOOPNAMING_DUMP_ID;
60 /// attribute name of dumping by geometric selection
61 inline static const std::string& GEOMETRIC_DUMP_ID()
63 static const std::string MY_GEOM_DUMP_ID("geometric_selection");
64 return MY_GEOM_DUMP_ID;
67 /// attribute name of dumping by using weak naming identifiers of selection
68 inline static const std::string& WEAK_NAMING_DUMP_ID()
70 static const std::string MY_WEAK_NAMING_DUMP_ID("weak_naming");
71 return MY_WEAK_NAMING_DUMP_ID;
74 /// Default constructor
75 EXCHANGEPLUGIN_EXPORT ExchangePlugin_Dump();
76 /// Default destructor
77 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_Dump();
79 /// Returns the unique kind of a feature
80 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind()
82 return ExchangePlugin_Dump::ID();
85 /// Request for initialization of data model of the feature: adding all attributes
86 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
88 /// Computes or recomputes the results
89 EXCHANGEPLUGIN_EXPORT virtual void execute();
91 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
92 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
94 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
95 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
98 /// Performs dump to the file
99 EXCHANGEPLUGIN_EXPORT void dump(const std::string& theFileName);