1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ExchangePlugin_ImportFeature.h
6 * Created on: Aug 28, 2014
10 #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
11 #define EXCHANGEPLUGIN_IMPORTFEATURE_H_
13 #include <ExchangePlugin.h>
14 #include <ModelAPI_Feature.h>
20 #define LibHandle HMODULE
21 #define LoadLib( name ) LoadLibrary( name )
22 #define GetProc GetProcAddress
23 #define UnLoadLib( handle ) FreeLibrary( handle );
26 #define LibHandle void*
27 #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL)
29 #define UnLoadLib( handle ) dlclose( handle );
32 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
36 inline static const std::string& ID()
38 static const std::string MY_IMPORT_ID("Import");
41 /// attribute name of referenced face
42 inline static const std::string& FILE_PATH_ID()
44 static const std::string MY_FILE_PATH_ID("import_file_selector");
45 return MY_FILE_PATH_ID;
48 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
49 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
51 /// Returns the unique kind of a feature
52 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
54 /// Request for initialization of data model of the feature: adding all attributes
55 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
57 /// Computes or recomputes the results
58 EXCHANGEPLUGIN_EXPORT virtual void execute();
60 EXCHANGEPLUGIN_EXPORT virtual bool isInHistory()
66 EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
67 EXCHANGEPLUGIN_EXPORT LibHandle loadImportPlugin(const std::string& theFormatName);
70 /// Loads Naming data structure to the document
71 void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape,
72 std::shared_ptr<ModelAPI_ResultBody> theResultBody);
75 #endif /* IMPORT_IMPORTFEATURE_H_ */