Salome HOME
Fix of too long line problem.
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_ExportFeature.h
index 9a71b05618ae5106b7e886a78b94b10a995c7618..c0a79a8c5ea092bcbbba0d7fff00d3a97f0d6d7a 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:    ExchangePlugin_ExportFeature.h
-// Created: May 14, 2015
-// Author:  Sergey POKHODENKO
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #ifndef EXCHANGEPLUGIN_EXPORTFEATURE_H_
 #define EXCHANGEPLUGIN_EXPORTFEATURE_H_
@@ -41,6 +54,12 @@ public:
     static const std::string MY_FILE_PATH_ID("file_path");
     return MY_FILE_PATH_ID;
   }
+  /// attribute name of xao file path
+  inline static const std::string& XAO_FILE_PATH_ID()
+  {
+    static const std::string MY_XAO_FILE_PATH_ID("xao_file_path");
+    return MY_XAO_FILE_PATH_ID;
+  }
   /// attribute name of file format
   inline static const std::string& FILE_FORMAT_ID()
   {
@@ -59,6 +78,12 @@ public:
     static const std::string MY_XAO_AUTHOR_ID("xao_author");
     return MY_XAO_AUTHOR_ID;
   }
+  /// attribute name of geometry name for XAO format
+  inline static const std::string& XAO_GEOMETRY_NAME_ID()
+  {
+    static const std::string MY_XAO_GEOMETRY_NAME_ID("xao_geometry_name");
+    return MY_XAO_GEOMETRY_NAME_ID;
+  }
   /// Default constructor
   EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature();
   /// Default destructor
@@ -73,24 +98,31 @@ public:
   /// Request for initialization of data model of the feature: adding all attributes
   EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
 
+  /// Reimplemented from ModelAPI_Feature::attributeChanged()
+  EXCHANGEPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
+
   /// Computes or recomputes the results
   EXCHANGEPLUGIN_EXPORT virtual void execute();
 
-  /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true.
-  EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const { return true; }
+  /// Reimplemented from ModelAPI_Feature::isMacro(). Returns false.
+  // It is macro for not-XAO export. For XAO the feature is kept invisible in the tree
+  // for the export to GEOM functionality correct working.
+  EXCHANGEPLUGIN_EXPORT virtual bool isMacro() const;
 
   /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
   EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
 
+  /// Do not put in history.
+  /// Since it is not a macro, it is not deleted, but we don't want to see it.
+  bool isInHistory()  { return false; }
+
 protected:
   /// Performs export of the file
   EXCHANGEPLUGIN_EXPORT void exportFile(const std::string& theFileName,
-                                        const std::string& theFormat,
-                                        std::shared_ptr<GeomAPI_Shape> theShape);
+                                        const std::string& theFormat);
 
   /// Performs export to XAO file
-  EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string& theFileName,
-                                       std::shared_ptr<GeomAPI_Shape> theShape);
+  EXCHANGEPLUGIN_EXPORT void exportXAO(const std::string& theFileName);
 };
 
 #endif /* EXPORT_EXPORTFEATURE_H_ */