1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ExchangePlugin_ImportFeature.h
4 // Created: Aug 28, 2014
5 // Author: Sergey BELASH
7 #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
8 #define EXCHANGEPLUGIN_IMPORTFEATURE_H_
10 #include <ExchangePlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <ModelAPI_Result.h>
17 * \class ExchangePlugin_ImportFeature
19 * \brief Feature for import shapes from the external files in CAD formats.
21 * The list of supported formats is defined in the configuration file.
23 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
27 inline static const std::string& ID()
29 static const std::string MY_IMPORT_ID("Import");
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 /// Default constructor
39 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
40 /// Default destructor
41 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
43 /// Returns the unique kind of a feature
44 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
46 /// Request for initialization of data model of the feature: adding all attributes
47 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
49 /// Computes or recomputes the results
50 EXCHANGEPLUGIN_EXPORT virtual void execute();
52 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
53 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
56 /// Performs the import of the file
57 EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
60 /// Loads Naming data structure to the document
61 void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
62 std::shared_ptr<ModelAPI_ResultBody> theResultBody);
65 #endif /* IMPORT_IMPORTFEATURE_H_ */