1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
4 #define EXCHANGEPLUGIN_IMPORTFEATURE_H_
6 #include <ExchangePlugin.h>
7 #include <ModelAPI_Feature.h>
9 #include <GeomAPI_ICustomPrs.h>
13 #define IMPORTED_FEATURE_COLOR "#E0A01B"
15 /**\class ExchangePlugin_ImportFeature
17 * \brief Feature for import shapes from the external files in CAD formats.
19 * The set of supported formats is defined in the configuration file.
21 class ExchangePlugin_ImportFeature : public ModelAPI_Feature, public GeomAPI_ICustomPrs
25 inline static const std::string& ID()
27 static const std::string MY_IMPORT_ID("Import");
30 /// attribute name of referenced face
31 inline static const std::string& FILE_PATH_ID()
33 static const std::string MY_FILE_PATH_ID("import_file_selector");
34 return MY_FILE_PATH_ID;
36 /// default constructor
37 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
38 /// default destructor
39 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
41 /// Returns the unique kind of a feature
42 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
44 /// Request for initialization of data model of the feature: adding all attributes
45 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
47 /// Computes or recomputes the results
48 EXCHANGEPLUGIN_EXPORT virtual void execute();
50 EXCHANGEPLUGIN_EXPORT virtual bool isInHistory()
55 /// Modifies the given presentation in the custom way.
56 virtual void customisePresentation(AISObjectPtr thePrs);
59 /// POerforms the import of the file
60 EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
63 /// Loads Naming data structure to the document
64 void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
65 std::shared_ptr<ModelAPI_ResultBody> theResultBody);
68 #endif /* IMPORT_IMPORTFEATURE_H_ */