1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ExchangePlugin_ExportFeature.h
4 // Created: May 14, 2015
5 // Author: Sergey POKHODENKO
7 #ifndef EXCHANGEPLUGIN_EXPORTFEATURE_H_
8 #define EXCHANGEPLUGIN_EXPORTFEATURE_H_
10 #include <ExchangePlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <ModelAPI_Result.h>
17 * \class ExchangePlugin_ExportFeature
19 * \brief Feature for export shapes to the external files in CAD formats.
21 * The list of supported formats is defined in the configuration file.
23 class ExchangePlugin_ExportFeature : public ModelAPI_Feature
27 inline static const std::string& ID()
29 static const std::string MY_EXPORT_ID("Export");
32 /// attribute name for file format
33 inline static const std::string& EXPORT_TYPE_ID()
35 static const std::string MY_EXPORT_TYPE_ID("ExportType");
36 return MY_EXPORT_TYPE_ID;
38 /// attribute name of file path
39 inline static const std::string& FILE_PATH_ID()
41 static const std::string MY_FILE_PATH_ID("file_path");
42 return MY_FILE_PATH_ID;
44 /// attribute name of xao file path
45 inline static const std::string& XAO_FILE_PATH_ID()
47 static const std::string MY_XAO_FILE_PATH_ID("xao_file_path");
48 return MY_XAO_FILE_PATH_ID;
50 /// attribute name of file format
51 inline static const std::string& FILE_FORMAT_ID()
53 static const std::string MY_FILE_FORMAT_ID("file_format");
54 return MY_FILE_FORMAT_ID;
56 /// attribute name of selection list
57 inline static const std::string& SELECTION_LIST_ID()
59 static const std::string MY_SELECTION_LIST_ID("selection_list");
60 return MY_SELECTION_LIST_ID;
62 /// attribute name of author for XAO format
63 inline static const std::string& XAO_AUTHOR_ID()
65 static const std::string MY_XAO_AUTHOR_ID("xao_author");
66 return MY_XAO_AUTHOR_ID;
68 /// attribute name of geometry name for XAO format
69 inline static const std::string& XAO_GEOMETRY_NAME_ID()
71 static const std::string MY_XAO_GEOMETRY_NAME_ID("xao_geometry_name");
72 return MY_XAO_GEOMETRY_NAME_ID;
74 /// Default constructor
75 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature();
76 /// Default destructor
77 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ExportFeature();
79 /// Returns the unique kind of a feature
80 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind()
82 return ExchangePlugin_ExportFeature::ID();
85 /// Request for initialization of data model of the feature: adding all attributes
86 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
88 /// Reimplemented from ModelAPI_Feature::attributeChanged()
89 EXCHANGEPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
91 /// Computes or recomputes the results
92 EXCHANGEPLUGIN_EXPORT virtual void execute();
94 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
95 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
97 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
98 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
101 /// Performs export of the file
102 EXCHANGEPLUGIN_EXPORT void exportFile(const std::string& theFileName,
103 const std::string& theFormat);
105 /// Performs export to XAO file
106 EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string& theFileName);
109 #endif /* EXPORT_EXPORTFEATURE_H_ */