X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_ImportFeature.h;h=d7cf695b438675fe9afb7454f1929f84d55e1e04;hb=e32f95642855a63da2727cb324ce2a75632a712f;hp=4b3b7a80399296265a19a91a5fcae668d2ef024e;hpb=b97f4d67421685f99412ee79484c7a8482da1d2e;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h index 4b3b7a803..d7cf695b4 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h @@ -1,69 +1,65 @@ -/* - * ExchangePlugin_ImportFeature.h - * - * Created on: Aug 28, 2014 - * Author: sbh - */ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +// File: ExchangePlugin_ImportFeature.h +// Created: Aug 28, 2014 +// Author: Sergey BELASH #ifndef EXCHANGEPLUGIN_IMPORTFEATURE_H_ #define EXCHANGEPLUGIN_IMPORTFEATURE_H_ #include #include +#include #include -#ifdef WIN32 -#include -#define LibHandle HMODULE -#define LoadLib( name ) LoadLibrary( name ) -#define GetProc GetProcAddress -#define UnLoadLib( handle ) FreeLibrary( handle ); -#else -#include -#define LibHandle void* -#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL) -#define GetProc dlsym -#define UnLoadLib( handle ) dlclose( handle ); -#endif - -class EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature : public ModelAPI_Feature +/** + * \class ExchangePlugin_ImportFeature + * \ingroup Plugins + * \brief Feature for import shapes from the external files in CAD formats. + * + * The list of supported formats is defined in the configuration file. + */ +class ExchangePlugin_ImportFeature : public ModelAPI_Feature { public: - /// Extrusion kind + /// Feature kind inline static const std::string& ID() { static const std::string MY_IMPORT_ID("Import"); return MY_IMPORT_ID; } - /// attribute name of referenced face + /// attribute name of file path inline static const std::string& FILE_PATH_ID() { - static const std::string MY_FILE_PATH_ID("import_file_selector"); + static const std::string MY_FILE_PATH_ID("file_path"); return MY_FILE_PATH_ID; } - - ExchangePlugin_ImportFeature(); - virtual ~ExchangePlugin_ImportFeature(); + /// Default constructor + EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature(); + /// Default destructor + EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature(); /// Returns the unique kind of a feature - virtual const std::string& getKind(); + EXCHANGEPLUGIN_EXPORT virtual const std::string& getKind(); /// Request for initialization of data model of the feature: adding all attributes - virtual void initAttributes(); + EXCHANGEPLUGIN_EXPORT virtual void initAttributes(); /// Computes or recomputes the results - virtual void execute(); + EXCHANGEPLUGIN_EXPORT virtual void execute(); - virtual bool isInHistory() - { - return false; - } + /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false. + EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; } protected: - bool importFile(const std::string& theFileName); - LibHandle loadImportPlugin(const std::string& theFormatName); - + /// Performs the import of the file + EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName); + +private: + /// Loads Naming data structure to the document + void loadNamingDS(std::shared_ptr theGeomShape, + std::shared_ptr theResultBody); }; #endif /* IMPORT_IMPORTFEATURE_H_ */