Salome HOME
Salome's 7.5.0 import BREP/STEP methods extraction
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_ImportFeature.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
4 #define EXCHANGEPLUGIN_IMPORTFEATURE_H_
5
6 #include <ExchangePlugin.h>
7 #include <ModelAPI_Feature.h>
8
9 #include <map>
10
11 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
12 {
13  public:
14   /// Extrusion kind
15   inline static const std::string& ID()
16   {
17     static const std::string MY_IMPORT_ID("Import");
18     return MY_IMPORT_ID;
19   }
20   /// attribute name of referenced face
21   inline static const std::string& FILE_PATH_ID()
22   {
23     static const std::string MY_FILE_PATH_ID("import_file_selector");
24     return MY_FILE_PATH_ID;
25   }
26
27   EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
28   EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
29
30   /// Returns the unique kind of a feature
31   EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
32
33   /// Request for initialization of data model of the feature: adding all attributes
34   EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
35
36   /// Computes or recomputes the results
37   EXCHANGEPLUGIN_EXPORT virtual void execute();
38
39   EXCHANGEPLUGIN_EXPORT virtual bool isInHistory()
40   {
41     return true;
42   }
43
44  protected:
45   EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
46
47 private:
48   /// Loads Naming data structure to the document
49   void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape, 
50                                         std::shared_ptr<ModelAPI_ResultBody> theResultBody);
51 };
52
53 #endif /* IMPORT_IMPORTFEATURE_H_ */