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>
16 /**\class ExchangePlugin_ImportFeature
18 * \brief Feature for import shapes from the external files in CAD formats.
20 * The set of supported formats is defined in the configuration file.
22 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
26 inline static const std::string& ID()
28 static const std::string MY_IMPORT_ID("Import");
31 /// attribute name of referenced face
32 inline static const std::string& FILE_PATH_ID()
34 static const std::string MY_FILE_PATH_ID("import_file_selector");
35 return MY_FILE_PATH_ID;
37 /// default constructor
38 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
39 /// default destructor
40 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
42 /// Returns the unique kind of a feature
43 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
45 /// Request for initialization of data model of the feature: adding all attributes
46 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
48 /// Computes or recomputes the results
49 EXCHANGEPLUGIN_EXPORT virtual void execute();
51 /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
52 EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
55 /// Performs the import of the file
56 EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
59 /// Loads Naming data structure to the document
60 void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
61 std::shared_ptr<ModelAPI_ResultBody> theResultBody);
64 #endif /* IMPORT_IMPORTFEATURE_H_ */