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
22 inline static const std::string& ID()
24 static const std::string MY_EXPORT_ID("Export");
27 /// attribute name of referenced face
28 inline static const std::string& FILE_PATH_ID()
30 static const std::string MY_FILE_PATH_ID("export_file_selector");
31 return MY_FILE_PATH_ID;
33 /// default constructor
34 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature();
35 /// default destructor
36 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ExportFeature();
38 /// Request for initialization of data model of the feature: adding all attributes
39 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
41 /// Returns the unique kind of a feature
42 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
44 /// Computes or recomputes the results
45 EXCHANGEPLUGIN_EXPORT virtual void execute();
47 /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
48 EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
49 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
50 MODELAPI_EXPORT virtual bool isPreviewNeeded() const { return false; }
53 /// Performs the export of the file
54 EXCHANGEPLUGIN_EXPORT bool exportFile(const std::string& theFileName);
57 /// Loads Naming data structure to the document
58 void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
59 std::shared_ptr<ModelAPI_ResultBody> theResultBody);
62 #endif /* EXPORT_EXPORTFEATURE_H_ */