1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #ifndef EXCHANGEPLUGIN_EXPORTFEATURE_H_
4 #define EXCHANGEPLUGIN_EXPORTFEATURE_H_
6 #include <ExchangePlugin.h>
7 #include <ModelAPI_Feature.h>
8 #include <ModelAPI_Result.h>
12 /**\class ExchangePlugin_ExportFeature
14 * \brief Feature for export shapes to the external files in CAD formats.
16 * The set of supported formats is defined in the configuration file.
18 class ExchangePlugin_ExportFeature : public ModelAPI_Feature
21 inline static const std::string& ID()
23 static const std::string MY_EXPORT_ID("Export");
26 /// attribute name of file path
27 inline static const std::string& FILE_PATH_ID()
29 static const std::string MY_FILE_PATH_ID("export_file_selector");
30 return MY_FILE_PATH_ID;
32 /// attribute name of selection list
33 inline static const std::string& SELECTION_LIST_ID()
35 static const std::string MY_SELECTION_LIST_ID("selection_list");
36 return MY_SELECTION_LIST_ID;
38 /// default constructor
39 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature();
40 /// default destructor
41 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ExportFeature();
43 /// Request for initialization of data model of the feature: adding all attributes
44 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
46 /// Returns the unique kind of a feature
47 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
49 /// Computes or recomputes the results
50 EXCHANGEPLUGIN_EXPORT virtual void execute();
52 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
53 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
54 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
55 MODELAPI_EXPORT virtual bool isPreviewNeeded() const { return false; }
58 /// Performs the export of the file
59 EXCHANGEPLUGIN_EXPORT bool exportFile(const std::string& theFileName,
60 std::shared_ptr<GeomAPI_Shape> theShape);
63 #endif /* EXPORT_EXPORTFEATURE_H_ */