2 * ExchangePlugin_ImportFeature.h
4 * Created on: Aug 28, 2014
8 #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_
9 #define EXCHANGEPLUGIN_IMPORTFEATURE_H_
11 #include <ExchangePlugin.h>
12 #include <ModelAPI_Feature.h>
18 #define LibHandle HMODULE
19 #define LoadLib( name ) LoadLibrary( name )
20 #define GetProc GetProcAddress
21 #define UnLoadLib( handle ) FreeLibrary( handle );
24 #define LibHandle void*
25 #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL)
27 #define UnLoadLib( handle ) dlclose( handle );
30 class ExchangePlugin_ImportFeature : public ModelAPI_Feature
34 inline static const std::string& ID()
36 static const std::string MY_IMPORT_ID("Import");
39 /// attribute name of referenced face
40 inline static const std::string& FILE_PATH_ID()
42 static const std::string MY_FILE_PATH_ID("import_file_selector");
43 return MY_FILE_PATH_ID;
46 EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
47 EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
49 /// Returns the unique kind of a feature
50 EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind();
52 /// Request for initialization of data model of the feature: adding all attributes
53 EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
55 /// Computes or recomputes the results
56 EXCHANGEPLUGIN_EXPORT virtual void execute();
58 EXCHANGEPLUGIN_EXPORT virtual bool isInHistory()
64 EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
65 EXCHANGEPLUGIN_EXPORT LibHandle loadImportPlugin(const std::string& theFormatName);
69 #endif /* IMPORT_IMPORTFEATURE_H_ */