Salome HOME
Task 3.2. Concealment into multi-level Compounds
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_BooleanFuse.h
index bbd6216ba214e7e1cc5381d24771cca479fcc682..f94498406a0326a669de4763ce10164e6e330e00 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// 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
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef FeaturesPlugin_BooleanFuse_H_
@@ -23,6 +22,8 @@
 
 #include "FeaturesPlugin_Boolean.h"
 
+class GeomAlgoAPI_MakeShapeList;
+
 /// \class FeaturesPlugin_BooleanFuse
 /// \ingroup Plugins
 /// \brief Feature for applying of Boolean Fuse operation.
@@ -44,11 +45,68 @@ public:
     return MY_KIND;
   }
 
+  /// Attribute name for creation method.
+  inline static const std::string& CREATION_METHOD()
+  {
+    static const std::string MY_CREATION_METHOD_ID("creation_method");
+    return MY_CREATION_METHOD_ID;
+  }
+
+  /// Attribute name for creation method.
+  inline static const std::string& CREATION_METHOD_SIMPLE()
+  {
+    static const std::string MY_CREATION_METHOD_ID("simple");
+    return MY_CREATION_METHOD_ID;
+  }
+
+  /// Attribute name for creation method.
+  inline static const std::string& CREATION_METHOD_ADVANCED()
+  {
+    static const std::string MY_CREATION_METHOD_ID("advanced");
+    return MY_CREATION_METHOD_ID;
+  }
+
+  /// Attribute name of main objects.
+  inline static const std::string& OBJECT_LIST_ID()
+  {
+    static const std::string MY_OBJECT_LIST_ID("main_objects");
+    return MY_OBJECT_LIST_ID;
+  }
+
+  /// Attribute name of tool objects.
+  inline static const std::string& TOOL_LIST_ID()
+  {
+    static const std::string MY_TOOL_LIST_ID("tool_objects");
+    return MY_TOOL_LIST_ID;
+  }
+
+  /// Attribute name of remove edges option.
+  inline static const std::string& REMOVE_INTERSECTION_EDGES_ID()
+  {
+    static const std::string MY_TOOL_LIST_ID("remove_intersection_edges");
+    return MY_TOOL_LIST_ID;
+  }
+
+  /// Request for initialization of data model of the feature: adding all attributes.
+  FEATURESPLUGIN_EXPORT virtual void initAttributes();
+
+  /// Creates a new part document if needed.
+  FEATURESPLUGIN_EXPORT virtual void execute();
+
 public:
 
-    /// Use plugin manager for features creation.
-  FeaturesPlugin_BooleanFuse(): FeaturesPlugin_Boolean(BOOL_FUSE) {};
+  /// Use plugin manager for features creation.
+  FeaturesPlugin_BooleanFuse();
 
+private:
+  /// Process unused sub-shapes of compounds.
+  /// Keep the compound hierarchy, but merge top-level compounds
+  /// into a single compound and add the result of the FUSE operation.
+  GeomShapePtr keepUnusedSubsOfCompound(
+      const GeomShapePtr& theFuseResult,
+      const ObjectHierarchy& theObjectsHierarchy,
+      const ObjectHierarchy& theToolsHierarchy,
+      std::shared_ptr<GeomAlgoAPI_MakeShapeList> theMakeShapeList);
 };
 
 #endif