SHAPER  9.12.0
ExchangePlugin_ExportPart.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef EXCHANGEPLUGIN_EXPORTPART_H_
21 #define EXCHANGEPLUGIN_EXPORTPART_H_
22 
23 #include <ExchangePlugin.h>
24 #include <ModelAPI_Feature.h>
25 
32 {
33 public:
35  inline static const std::string& ID()
36  {
37  static const std::string MY_EXPORT_ID("ExportPart");
38  return MY_EXPORT_ID;
39  }
41  inline static const std::string& FILE_PATH_ID()
42  {
43  static const std::string MY_FILE_PATH_ID("file_path");
44  return MY_FILE_PATH_ID;
45  }
47  inline static const std::string& FILE_FORMAT_ID()
48  {
49  static const std::string MY_FILE_FORMAT_ID("file_format");
50  return MY_FILE_FORMAT_ID;
51  }
53  inline static const std::string& SELECTION_LIST_ID()
54  {
55  static const std::string MY_SELECTION_LIST_ID("selection_list");
56  return MY_SELECTION_LIST_ID;
57  }
60 
62  EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind()
63  {
65  }
66 
68  EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
69 
71  EXCHANGEPLUGIN_EXPORT virtual void execute();
72 
74  EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
75 
77  EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
78 
81  bool isInHistory() { return false; }
82 };
83 
84 #endif /* EXCHANGEPLUGIN_EXPORTPART_H_ */
Feature for export some results of a Part to the binary format for the further import.
Definition: ExchangePlugin_ExportPart.h:32
static const std::string & FILE_PATH_ID()
attribute name of file path
Definition: ExchangePlugin_ExportPart.h:41
static const std::string & SELECTION_LIST_ID()
attribute name of selection list
Definition: ExchangePlugin_ExportPart.h:53
virtual EXCHANGEPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: ExchangePlugin_ExportPart.cpp:60
static const std::string & ID()
Feature kind.
Definition: ExchangePlugin_ExportPart.h:35
virtual EXCHANGEPLUGIN_EXPORT void execute()
Computes or recomputes the results.
Definition: ExchangePlugin_ExportPart.cpp:69
virtual EXCHANGEPLUGIN_EXPORT const std::string & getKind()
Returns the unique kind of a feature.
Definition: ExchangePlugin_ExportPart.h:62
ExchangePlugin_ExportPart()
Default constructor.
Definition: ExchangePlugin_ExportPart.cpp:56
virtual EXCHANGEPLUGIN_EXPORT bool isMacro() const
Returns true if this feature is used as macro: creates other features and then removed.
Definition: ExchangePlugin_ExportPart.h:74
static const std::string & FILE_FORMAT_ID()
attribute name of file format
Definition: ExchangePlugin_ExportPart.h:47
virtual EXCHANGEPLUGIN_EXPORT bool isPreviewNeeded() const
Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
Definition: ExchangePlugin_ExportPart.h:77
bool isInHistory()
Do not put in history.
Definition: ExchangePlugin_ExportPart.h:81
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39