Salome HOME
Update the doxygen documentation for plugins
[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
12  * \ingroup Plugins
13  * \brief Feature for import shapes from the external files in CAD formats.
14  *
15  * The set of supported formats is defined in the configuration file.
16  */
17 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
18 {
19  public:
20   /// Extrusion kind
21   inline static const std::string& ID()
22   {
23     static const std::string MY_IMPORT_ID("Import");
24     return MY_IMPORT_ID;
25   }
26   /// attribute name of referenced face
27   inline static const std::string& FILE_PATH_ID()
28   {
29     static const std::string MY_FILE_PATH_ID("import_file_selector");
30     return MY_FILE_PATH_ID;
31   }
32   /// default constructor
33   EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
34   /// default destructor
35   EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
36
37   /// Returns the unique kind of a feature
38   EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
39
40   /// Request for initialization of data model of the feature: adding all attributes
41   EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
42
43   /// Computes or recomputes the results
44   EXCHANGEPLUGIN_EXPORT virtual void execute();
45
46   EXCHANGEPLUGIN_EXPORT virtual bool isInHistory()
47   {
48     return true;
49   }
50
51  protected:
52   /// POerforms the import of the file
53   EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
54
55 private:
56   /// Loads Naming data structure to the document
57   void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape, 
58                                         std::shared_ptr<ModelAPI_ResultBody> theResultBody);
59 };
60
61 #endif /* IMPORT_IMPORTFEATURE_H_ */