Salome HOME
Partition naming
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_ImportFeature.h
index 6a90bf0b9014b11c8c568113a9eac2c005a46270..d7cf695b438675fe9afb7454f1929f84d55e1e04 100644 (file)
@@ -1,49 +1,43 @@
-/*
- * 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 <ExchangePlugin.h>
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
 
 #include <map>
 
-#ifdef WIN32
-#include <windows.h>
-#define LibHandle HMODULE
-#define LoadLib( name ) LoadLibrary( name )
-#define GetProc GetProcAddress
-#define UnLoadLib( handle ) FreeLibrary( handle );
-#else
-#include <dlfcn.h>
-#define LibHandle void*
-#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL)
-#define GetProc dlsym
-#define UnLoadLib( handle ) dlclose( handle );
-#endif
-
+/**
+ * \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;
   }
-
+  /// Default constructor
   EXCHANGEPLUGIN_EXPORT ExchangePlugin_ImportFeature();
+  /// Default destructor
   EXCHANGEPLUGIN_EXPORT virtual ~ExchangePlugin_ImportFeature();
 
   /// Returns the unique kind of a feature
@@ -55,19 +49,17 @@ class ExchangePlugin_ImportFeature : public ModelAPI_Feature
   /// Computes or recomputes the results
   EXCHANGEPLUGIN_EXPORT virtual void execute();
 
-  EXCHANGEPLUGIN_EXPORT virtual bool isInHistory()
-  {
-    return true;
-  }
+  /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
+  EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
 
  protected:
+  /// Performs the import of the file
   EXCHANGEPLUGIN_EXPORT bool importFile(const std::string& theFileName);
-  EXCHANGEPLUGIN_EXPORT LibHandle loadImportPlugin(const std::string& theFormatName);
 
 private:
   /// Loads Naming data structure to the document
-  void loadNamingDS(boost::shared_ptr<GeomAPI_Shape> theGeomShape, 
-                                       boost::shared_ptr<ModelAPI_ResultBody> theResultBody);
+  void loadNamingDS(std::shared_ptr<GeomAPI_Shape> theGeomShape, 
+                    std::shared_ptr<ModelAPI_ResultBody> theResultBody);
 };
 
 #endif /* IMPORT_IMPORTFEATURE_H_ */