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 of file path
33 inline static const std::string& FILE_PATH_ID()
35 static const std::string MY_FILE_PATH_ID("file_path");
36 return MY_FILE_PATH_ID;
38 /// attribute name of file format
39 inline static const std::string& FILE_FORMAT_ID()
41 static const std::string MY_FILE_FORMAT_ID("file_format");
42 return MY_FILE_FORMAT_ID;
44 /// attribute name of selection list
45 inline static const std::string& SELECTION_LIST_ID()
47 static const std::string MY_SELECTION_LIST_ID("selection_list");
48 return MY_SELECTION_LIST_ID;
50 /// Default constructor
51 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature();
52 /// Default destructor
53 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ExportFeature();
55 /// Request for initialization of data model of the feature: adding all attributes
56 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
58 /// Returns the unique kind of a feature
59 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
61 /// Computes or recomputes the results
62 EXCHANGEPLUGIN_EXPORT virtual void execute();
64 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
65 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
67 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
68 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
71 /// Performs the export of the file
72 EXCHANGEPLUGIN_EXPORT bool exportFile(const std::string& theFileName,
73 const std::string& theFormat,
74 std::shared_ptr<GeomAPI_Shape> theShape);
77 #endif /* EXPORT_EXPORTFEATURE_H_ */