Salome HOME
3.6 Separation of Boolean operations
authordbv <dbv@opencascade.com>
Sun, 1 Jul 2018 17:50:53 +0000 (20:50 +0300)
committerdbv <dbv@opencascade.com>
Sun, 1 Jul 2018 17:50:53 +0000 (20:50 +0300)
48 files changed:
src/CollectionPlugin/Test/TestGroup.py
src/FeaturesAPI/CMakeLists.txt
src/FeaturesAPI/FeaturesAPI.i
src/FeaturesAPI/FeaturesAPI_Boolean.cpp [deleted file]
src/FeaturesAPI/FeaturesAPI_Boolean.h [deleted file]
src/FeaturesAPI/FeaturesAPI_BooleanCommon.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanCommon.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanCut.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanCut.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanFill.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanFill.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanFuse.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_BooleanSmash.h [new file with mode: 0644]
src/FeaturesAPI/FeaturesAPI_swig.h
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp
src/FeaturesPlugin/FeaturesPlugin_Boolean.h
src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.h [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_BooleanCut.h [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_BooleanFill.h [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.h [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.h [new file with mode: 0644]
src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
src/FeaturesPlugin/FeaturesPlugin_Validators.h
src/FeaturesPlugin/Test/Test2194.py
src/FeaturesPlugin/Test/Test2375.py
src/FeaturesPlugin/Test/Test2394.py
src/FeaturesPlugin/Test/TestBoolean.py
src/FeaturesPlugin/Test/TestBooleanCompSolids.py
src/FeaturesPlugin/Test/TestBooleanSmash.py
src/FeaturesPlugin/Test/TestFillCompFaceSolid.py
src/FeaturesPlugin/Test/TestFillShellSolid.py
src/FeaturesPlugin/Test/TestFillSolidCompFace.py
src/FeaturesPlugin/Test/TestFillSolidCompShell.py
src/FeaturesPlugin/Test/TestFillSolidShell.py
src/FeaturesPlugin/Test/TestMultiBoolean.py
src/FeaturesPlugin/Test/TestSerialBoolean.py
src/FeaturesPlugin/boolean_widget.xml
src/FeaturesPlugin/plugin-Features.xml
src/GeomValidators/CMakeLists.txt
src/GeomValidators/GeomValidators_BooleanArguments.cpp [deleted file]
src/GeomValidators/GeomValidators_BooleanArguments.h [deleted file]
src/GeomValidators/GeomValidators_Plugin.cpp
src/ModelAPI/Test/Test1512.py
src/ModelAPI/Test/Test2228.py

index ca834e5dfe727bdaa313ac9d256964d117b99277..0ecbd0ddcc35cf5f50bed2d186012f50daaac617 100644 (file)
@@ -234,11 +234,9 @@ aCylinderBody = modelAPI_ResultBody(anExtrusionFt.firstResult())
 # Create a cut
 #=========================================================================
 aSession.startOperation()
-aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt = aPart.addFeature("Cut")
 aBooleanFt.selectionList("main_objects").append(anExtrusionBody, None)
 aBooleanFt.selectionList("tool_objects").append(aCylinderBody, None)
-aBooleanTypeCut = 0
-aBooleanFt.integer("bool_type").setValue(aBooleanTypeCut)
 aBooleanFt.execute()
 aSession.finishOperation()
 
index 83e853688b8a54f2efe19def56dfe5c474a0c7a4..b511fc640dbfc008d3933856aa46ac03d8f16dfe 100644 (file)
@@ -22,7 +22,11 @@ INCLUDE(Common)
 
 SET(PROJECT_HEADERS
   FeaturesAPI.h
-  FeaturesAPI_Boolean.h
+  FeaturesAPI_BooleanCut.h
+  FeaturesAPI_BooleanFuse.h
+  FeaturesAPI_BooleanCommon.h
+  FeaturesAPI_BooleanSmash.h
+  FeaturesAPI_BooleanFill.h
   FeaturesAPI_Extrusion.h
   FeaturesAPI_ExtrusionBoolean.h
   FeaturesAPI_Fillet.h
@@ -45,7 +49,11 @@ SET(PROJECT_HEADERS
 )
 
 SET(PROJECT_SOURCES
-  FeaturesAPI_Boolean.cpp
+  FeaturesAPI_BooleanCut.cpp
+  FeaturesAPI_BooleanFuse.cpp
+  FeaturesAPI_BooleanCommon.cpp
+  FeaturesAPI_BooleanSmash.cpp
+  FeaturesAPI_BooleanFill.cpp
   FeaturesAPI_Extrusion.cpp
   FeaturesAPI_ExtrusionBoolean.cpp
   FeaturesAPI_Fillet.cpp
index 01d1c9197b4239835df6ef0ef6ea6b9a706dfc53..dd6b5897ff2cc212c8d7c5d16c23d7ecd41c9547 100644 (file)
 %include "std_shared_ptr.i"
 
 // shared pointers
-%shared_ptr(FeaturesAPI_Boolean)
+%shared_ptr(FeaturesAPI_BooleanCut)
+%shared_ptr(FeaturesAPI_BooleanFuse)
+%shared_ptr(FeaturesAPI_BooleanCommon)
+%shared_ptr(FeaturesAPI_BooleanSmash)
+%shared_ptr(FeaturesAPI_BooleanFill)
 %shared_ptr(FeaturesAPI_Extrusion)
 %shared_ptr(FeaturesAPI_ExtrusionBoolean)
 %shared_ptr(FeaturesAPI_ExtrusionCut)
 %shared_ptr(FeaturesAPI_Union)
 
 // all supported interfaces
-%include "FeaturesAPI_Boolean.h"
+%include "FeaturesAPI_BooleanCut.h"
+%include "FeaturesAPI_BooleanFuse.h"
+%include "FeaturesAPI_BooleanCommon.h"
+%include "FeaturesAPI_BooleanSmash.h"
+%include "FeaturesAPI_BooleanFill.h"
 %include "FeaturesAPI_Extrusion.h"
 %include "FeaturesAPI_ExtrusionBoolean.h"
 %include "FeaturesAPI_Fillet.h"
diff --git a/src/FeaturesAPI/FeaturesAPI_Boolean.cpp b/src/FeaturesAPI/FeaturesAPI_Boolean.cpp
deleted file mode 100644 (file)
index dda4405..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "FeaturesAPI_Boolean.h"
-
-#include <ModelHighAPI_Dumper.h>
-#include <ModelHighAPI_Integer.h>
-#include <ModelHighAPI_Selection.h>
-#include <ModelHighAPI_Tools.h>
-
-//==================================================================================================
-FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
-: ModelHighAPI_Interface(theFeature)
-{
-  initialize();
-}
-
-//==================================================================================================
-FeaturesAPI_Boolean::FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                         const ModelHighAPI_Integer& theBoolType,
-                                         const std::list<ModelHighAPI_Selection>& theMainObjects,
-                                         const std::list<ModelHighAPI_Selection>& theToolObjects)
-: ModelHighAPI_Interface(theFeature)
-{
-  if(initialize()) {
-    fillAttribute(theBoolType, myboolType);
-    fillAttribute(theMainObjects, mymainObjects);
-    fillAttribute(theToolObjects, mytoolObjects);
-
-    execute(false);
-  }
-}
-
-//==================================================================================================
-FeaturesAPI_Boolean::~FeaturesAPI_Boolean()
-{
-
-}
-
-//==================================================================================================
-void FeaturesAPI_Boolean::setBoolType(const ModelHighAPI_Integer& theBoolType)
-{
-  fillAttribute(theBoolType, myboolType);
-
-  execute();
-}
-
-//==================================================================================================
-void FeaturesAPI_Boolean::setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects)
-{
-  fillAttribute(theMainObjects, mymainObjects);
-
-  execute();
-}
-
-//==================================================================================================
-void FeaturesAPI_Boolean::setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects)
-{
-  fillAttribute(theToolObjects, mytoolObjects);
-
-  execute();
-}
-
-//==================================================================================================
-void FeaturesAPI_Boolean::dump(ModelHighAPI_Dumper& theDumper) const
-{
-  FeaturePtr aBase = feature();
-
-  FeaturesPlugin_Boolean::OperationType aType =
-      (FeaturesPlugin_Boolean::OperationType)aBase->integer(
-      FeaturesPlugin_Boolean::TYPE_ID())->value();
-
-  theDumper << aBase << " = model.add";
-
-  switch(aType) {
-    case FeaturesPlugin_Boolean::BOOL_CUT:    theDumper << "Cut";    break;
-    case FeaturesPlugin_Boolean::BOOL_FUSE:   theDumper << "Fuse";   break;
-    case FeaturesPlugin_Boolean::BOOL_COMMON: theDumper << "Common"; break;
-    case FeaturesPlugin_Boolean::BOOL_FILL:   theDumper << "Fill";   break;
-    case FeaturesPlugin_Boolean::BOOL_SMASH:  theDumper << "Smash";  break;
-  }
-
-  const std::string& aDocName = theDumper.name(aBase->document());
-  AttributeSelectionListPtr anObjects =
-    aBase->selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
-  AttributeSelectionListPtr aTools = aBase->selectionList(FeaturesPlugin_Boolean::TOOL_LIST_ID());
-
-  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
-}
-
-//==================================================================================================
-BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
-                  const std::list<ModelHighAPI_Selection>& theMainObjects,
-                  const std::list<ModelHighAPI_Selection>& theToolObjects)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
-  return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
-                                            FeaturesPlugin_Boolean::BOOL_CUT,
-                                            theMainObjects,
-                                            theToolObjects));
-}
-
-//==================================================================================================
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
-                   const std::list<ModelHighAPI_Selection>& theObjects)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
-  std::list<ModelHighAPI_Selection> aToolObjects;
-  return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
-                                            FeaturesPlugin_Boolean::BOOL_FUSE,
-                                            theObjects,
-                                            aToolObjects));
-}
-
-//==================================================================================================
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
-                   const std::list<ModelHighAPI_Selection>& theMainObjects,
-                   const std::list<ModelHighAPI_Selection>& theToolObjects)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
-  return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
-                                            FeaturesPlugin_Boolean::BOOL_FUSE,
-                                            theMainObjects,
-                                            theToolObjects));
-}
-
-//==================================================================================================
-BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
-                     const std::list<ModelHighAPI_Selection>& theMainObjects,
-                     const std::list<ModelHighAPI_Selection>& theToolObjects)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
-  return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
-                                            FeaturesPlugin_Boolean::BOOL_COMMON,
-                                            theMainObjects,
-                                            theToolObjects));
-}
-
-//==================================================================================================
-BooleanPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
-                    const std::list<ModelHighAPI_Selection>& theMainObjects,
-                    const std::list<ModelHighAPI_Selection>& theToolObjects)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
-  return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
-                                            FeaturesPlugin_Boolean::BOOL_SMASH,
-                                            theMainObjects,
-                                            theToolObjects));
-}
-
-//==================================================================================================
-BooleanPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
-                   const std::list<ModelHighAPI_Selection>& theMainObjects,
-                   const std::list<ModelHighAPI_Selection>& theToolObjects)
-{
-  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Boolean::ID());
-  return BooleanPtr(new FeaturesAPI_Boolean(aFeature,
-                                            FeaturesPlugin_Boolean::BOOL_FILL,
-                                            theMainObjects,
-                                            theToolObjects));
-}
diff --git a/src/FeaturesAPI/FeaturesAPI_Boolean.h b/src/FeaturesAPI/FeaturesAPI_Boolean.h
deleted file mode 100644 (file)
index 7b1b25e..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef FeaturesAPI_Boolean_H_
-#define FeaturesAPI_Boolean_H_
-
-#include "FeaturesAPI.h"
-
-#include <FeaturesPlugin_Boolean.h>
-
-#include <ModelHighAPI_Interface.h>
-#include <ModelHighAPI_Macro.h>
-
-class ModelHighAPI_Integer;
-class ModelHighAPI_Selection;
-
-/// \class FeaturesAPI_Boolean
-/// \ingroup CPPHighAPI
-/// \brief Interface for Boolean feature.
-class FeaturesAPI_Boolean: public ModelHighAPI_Interface
-{
-public:
-  /// Constructor without values.
-  FEATURESAPI_EXPORT
-  explicit FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature);
-
-  /// Constructor with values.
-  FEATURESAPI_EXPORT
-  FeaturesAPI_Boolean(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                      const ModelHighAPI_Integer& theBoolType,
-                      const std::list<ModelHighAPI_Selection>& theMainObjects,
-                      const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-  /// Destructor.
-  FEATURESAPI_EXPORT
-  virtual ~FeaturesAPI_Boolean();
-
-  INTERFACE_3(FeaturesPlugin_Boolean::ID(),
-              boolType, FeaturesPlugin_Boolean::TYPE_ID(),
-              ModelAPI_AttributeInteger, /** Operation type */,
-              mainObjects, FeaturesPlugin_Boolean::OBJECT_LIST_ID(),
-              ModelAPI_AttributeSelectionList, /** Main objects */,
-              toolObjects, FeaturesPlugin_Boolean::TOOL_LIST_ID(),
-              ModelAPI_AttributeSelectionList, /** Tool objects*/)
-
-  /// Set operation type.
-  FEATURESAPI_EXPORT
-  void setBoolType(const ModelHighAPI_Integer& theBoolType);
-
-  /// Set main objects.
-  FEATURESAPI_EXPORT
-  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
-
-  /// Set tool objects.
-  FEATURESAPI_EXPORT
-  void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-  /// Dump wrapped feature
-  FEATURESAPI_EXPORT
-  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
-};
-
-/// Pointer on Boolean object.
-typedef std::shared_ptr<FeaturesAPI_Boolean> BooleanPtr;
-
-/// \ingroup CPPHighAPI
-/// \brief Create Boolean Cut feature.
-FEATURESAPI_EXPORT
-BooleanPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
-                  const std::list<ModelHighAPI_Selection>& theMainObjects,
-                  const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-/// \ingroup CPPHighAPI
-/// \brief Create Boolean Fuse feature.
-FEATURESAPI_EXPORT
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
-                   const std::list<ModelHighAPI_Selection>& theObjects);
-
-/// \ingroup CPPHighAPI
-/// \brief Create Boolean Fuse feature.
-FEATURESAPI_EXPORT
-BooleanPtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
-                   const std::list<ModelHighAPI_Selection>& theMainObjects,
-                   const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-/// \ingroup CPPHighAPI
-/// \brief Create Boolean Common feature.
-FEATURESAPI_EXPORT
-BooleanPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
-                     const std::list<ModelHighAPI_Selection>& theMainObjects,
-                     const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-/// \ingroup CPPHighAPI
-/// \brief Create Boolean Smash feature.
-FEATURESAPI_EXPORT
-BooleanPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
-                    const std::list<ModelHighAPI_Selection>& theMainObjects,
-                    const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-/// \ingroup CPPHighAPI
-/// \brief Create Boolean Fill feature.
-FEATURESAPI_EXPORT
-BooleanPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
-                   const std::list<ModelHighAPI_Selection>& theMainObjects,
-                   const std::list<ModelHighAPI_Selection>& theToolObjects);
-
-#endif // FeaturesAPI_Boolean_H_
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanCommon.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanCommon.cpp
new file mode 100644 (file)
index 0000000..bd53854
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "FeaturesAPI_BooleanCommon.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theMainObjects,
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theMainObjects, mymainObjects);
+    fillAttribute(theToolObjects, mytoolObjects);
+
+    execute(false);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanCommon::~FeaturesAPI_BooleanCommon()
+{
+}
+
+
+//==================================================================================================
+void FeaturesAPI_BooleanCommon::setMainObjects(
+  const std::list<ModelHighAPI_Selection>& theMainObjects)
+{
+  fillAttribute(theMainObjects, mymainObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanCommon::setToolObjects(
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  fillAttribute(theToolObjects, mytoolObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanCommon::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+
+  theDumper << aBase << " = model.addCommon";
+
+  const std::string& aDocName = theDumper.name(aBase->document());
+  AttributeSelectionListPtr anObjects =
+    aBase->selectionList(FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID());
+  AttributeSelectionListPtr aTools =
+    aBase->selectionList(FeaturesPlugin_BooleanCommon::TOOL_LIST_ID());
+
+  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
+}
+
+//==================================================================================================
+BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
+                           const std::list<ModelHighAPI_Selection>& theMainObjects,
+                           const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
+  return BooleanCommonPtr(new FeaturesAPI_BooleanCommon(aFeature,
+                                                        theMainObjects,
+                                                        theToolObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanCommon.h b/src/FeaturesAPI/FeaturesAPI_BooleanCommon.h
new file mode 100644 (file)
index 0000000..56e49bb
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesAPI_BooleanCommon_H_
+#define FeaturesAPI_BooleanCommon_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_BooleanCommon.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Integer;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_BooleanCommon
+/// \ingroup CPPHighAPI
+/// \brief Interface for Boolean Common feature.
+class FeaturesAPI_BooleanCommon: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  FeaturesAPI_BooleanCommon(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                            const std::list<ModelHighAPI_Selection>& theMainObjects,
+                            const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_BooleanCommon();
+
+  INTERFACE_2(FeaturesPlugin_BooleanCommon::ID(),
+              mainObjects, FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Main objects */,
+              toolObjects, FeaturesPlugin_BooleanCommon::TOOL_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Tool objects*/)
+
+  /// Set main objects.
+  FEATURESAPI_EXPORT
+  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
+
+  /// Set tool objects.
+  FEATURESAPI_EXPORT
+  void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Dump wrapped feature
+  FEATURESAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Boolean object.
+typedef std::shared_ptr<FeaturesAPI_BooleanCommon> BooleanCommonPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Boolean Common feature.
+FEATURESAPI_EXPORT
+BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
+                           const std::list<ModelHighAPI_Selection>& theMainObjects,
+                           const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+#endif // FeaturesAPI_BooleanCommon_H_
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanCut.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanCut.cpp
new file mode 100644 (file)
index 0000000..496b1fd
--- /dev/null
@@ -0,0 +1,96 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "FeaturesAPI_BooleanCut.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_BooleanCut::FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanCut::FeaturesAPI_BooleanCut(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theMainObjects,
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theMainObjects, mymainObjects);
+    fillAttribute(theToolObjects, mytoolObjects);
+
+    execute(false);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanCut::~FeaturesAPI_BooleanCut()
+{
+}
+
+
+//==================================================================================================
+void FeaturesAPI_BooleanCut::setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects)
+{
+  fillAttribute(theMainObjects, mymainObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanCut::setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  fillAttribute(theToolObjects, mytoolObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanCut::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+
+  theDumper << aBase << " = model.addCut";
+
+  const std::string& aDocName = theDumper.name(aBase->document());
+  AttributeSelectionListPtr anObjects =
+    aBase->selectionList(FeaturesPlugin_BooleanCut::OBJECT_LIST_ID());
+  AttributeSelectionListPtr aTools =
+    aBase->selectionList(FeaturesPlugin_BooleanCut::TOOL_LIST_ID());
+
+  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
+}
+
+//==================================================================================================
+BooleanCutPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                     const std::list<ModelHighAPI_Selection>& theMainObjects,
+                     const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCut::ID());
+  return BooleanCutPtr(new FeaturesAPI_BooleanCut(aFeature,
+                                                  theMainObjects,
+                                                  theToolObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanCut.h b/src/FeaturesAPI/FeaturesAPI_BooleanCut.h
new file mode 100644 (file)
index 0000000..c39dd49
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesAPI_BooleanCut_H_
+#define FeaturesAPI_BooleanCut_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_BooleanCut.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Integer;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_BooleanCut
+/// \ingroup CPPHighAPI
+/// \brief Interface for Boolean Cut feature.
+class FeaturesAPI_BooleanCut: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  FeaturesAPI_BooleanCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                         const std::list<ModelHighAPI_Selection>& theMainObjects,
+                         const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_BooleanCut();
+
+  INTERFACE_2(FeaturesPlugin_BooleanCut::ID(),
+              mainObjects, FeaturesPlugin_BooleanCut::OBJECT_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Main objects */,
+              toolObjects, FeaturesPlugin_BooleanCut::TOOL_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Tool objects*/)
+
+  /// Set main objects.
+  FEATURESAPI_EXPORT
+  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
+
+  /// Set tool objects.
+  FEATURESAPI_EXPORT
+  void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Dump wrapped feature
+  FEATURESAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Boolean object.
+typedef std::shared_ptr<FeaturesAPI_BooleanCut> BooleanCutPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Boolean Cut feature.
+FEATURESAPI_EXPORT
+BooleanCutPtr addCut(const std::shared_ptr<ModelAPI_Document>& thePart,
+                     const std::list<ModelHighAPI_Selection>& theMainObjects,
+                     const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+#endif // FeaturesAPI_BooleanCut_H_
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanFill.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanFill.cpp
new file mode 100644 (file)
index 0000000..f992420
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "FeaturesAPI_BooleanFill.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_BooleanFill::FeaturesAPI_BooleanFill(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanFill::FeaturesAPI_BooleanFill(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theMainObjects,
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theMainObjects, mymainObjects);
+    fillAttribute(theToolObjects, mytoolObjects);
+
+    execute(false);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanFill::~FeaturesAPI_BooleanFill()
+{
+}
+
+
+//==================================================================================================
+void FeaturesAPI_BooleanFill::setMainObjects(
+  const std::list<ModelHighAPI_Selection>& theMainObjects)
+{
+  fillAttribute(theMainObjects, mymainObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanFill::setToolObjects(
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  fillAttribute(theToolObjects, mytoolObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanFill::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+
+  theDumper << aBase << " = model.addFill";
+
+  const std::string& aDocName = theDumper.name(aBase->document());
+  AttributeSelectionListPtr anObjects =
+    aBase->selectionList(FeaturesPlugin_BooleanFill::OBJECT_LIST_ID());
+  AttributeSelectionListPtr aTools =
+    aBase->selectionList(FeaturesPlugin_BooleanFill::TOOL_LIST_ID());
+
+  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
+}
+
+//==================================================================================================
+BooleanFillPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
+                       const std::list<ModelHighAPI_Selection>& theMainObjects,
+                       const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFill::ID());
+  return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature,
+                                                    theMainObjects,
+                                                    theToolObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanFill.h b/src/FeaturesAPI/FeaturesAPI_BooleanFill.h
new file mode 100644 (file)
index 0000000..32413f1
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesAPI_BooleanFill_H_
+#define FeaturesAPI_BooleanFill_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_BooleanFill.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Integer;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_BooleanFill
+/// \ingroup CPPHighAPI
+/// \brief Interface for Boolean Fill feature.
+class FeaturesAPI_BooleanFill: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_BooleanFill(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  FeaturesAPI_BooleanFill(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                          const std::list<ModelHighAPI_Selection>& theMainObjects,
+                          const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_BooleanFill();
+
+  INTERFACE_2(FeaturesPlugin_BooleanFill::ID(),
+              mainObjects, FeaturesPlugin_BooleanFill::OBJECT_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Main objects */,
+              toolObjects, FeaturesPlugin_BooleanFill::TOOL_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Tool objects*/)
+
+  /// Set main objects.
+  FEATURESAPI_EXPORT
+  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
+
+  /// Set tool objects.
+  FEATURESAPI_EXPORT
+  void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Dump wrapped feature
+  FEATURESAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Boolean object.
+typedef std::shared_ptr<FeaturesAPI_BooleanFill> BooleanFillPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Boolean Fill feature.
+FEATURESAPI_EXPORT
+BooleanFillPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
+                       const std::list<ModelHighAPI_Selection>& theMainObjects,
+                       const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+#endif // FeaturesAPI_BooleanFill_H_
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanFuse.cpp
new file mode 100644 (file)
index 0000000..c1a043d
--- /dev/null
@@ -0,0 +1,110 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "FeaturesAPI_BooleanFuse.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanFuse::FeaturesAPI_BooleanFuse(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theMainObjects,
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theMainObjects, mymainObjects);
+    fillAttribute(theToolObjects, mytoolObjects);
+
+    execute(false);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanFuse::~FeaturesAPI_BooleanFuse()
+{
+}
+
+
+//==================================================================================================
+void FeaturesAPI_BooleanFuse::setMainObjects(
+  const std::list<ModelHighAPI_Selection>& theMainObjects)
+{
+  fillAttribute(theMainObjects, mymainObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanFuse::setToolObjects(
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  fillAttribute(theToolObjects, mytoolObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanFuse::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+
+  theDumper << aBase << " = model.addFuse";
+
+  const std::string& aDocName = theDumper.name(aBase->document());
+  AttributeSelectionListPtr anObjects =
+    aBase->selectionList(FeaturesPlugin_BooleanFuse::OBJECT_LIST_ID());
+  AttributeSelectionListPtr aTools =
+    aBase->selectionList(FeaturesPlugin_BooleanFuse::TOOL_LIST_ID());
+
+  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
+}
+
+//==================================================================================================
+BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                       const std::list<ModelHighAPI_Selection>& theObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
+  std::list<ModelHighAPI_Selection> aToolObjects;
+  return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
+                                                    theObjects,
+                                                    aToolObjects));
+}
+
+//==================================================================================================
+BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                   const std::list<ModelHighAPI_Selection>& theMainObjects,
+                   const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFuse::ID());
+  return BooleanFusePtr(new FeaturesAPI_BooleanFuse(aFeature,
+                                                    theMainObjects,
+                                                    theToolObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanFuse.h b/src/FeaturesAPI/FeaturesAPI_BooleanFuse.h
new file mode 100644 (file)
index 0000000..17b72f7
--- /dev/null
@@ -0,0 +1,89 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesAPI_BooleanFuse_H_
+#define FeaturesAPI_BooleanFuse_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_BooleanFuse.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Integer;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_BooleanFuse
+/// \ingroup CPPHighAPI
+/// \brief Interface for Boolean Fuse feature.
+class FeaturesAPI_BooleanFuse: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  FeaturesAPI_BooleanFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                         const std::list<ModelHighAPI_Selection>& theMainObjects,
+                         const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_BooleanFuse();
+
+  INTERFACE_2(FeaturesPlugin_BooleanFuse::ID(),
+              mainObjects, FeaturesPlugin_BooleanFuse::OBJECT_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Main objects */,
+              toolObjects, FeaturesPlugin_BooleanFuse::TOOL_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Tool objects*/)
+
+  /// Set main objects.
+  FEATURESAPI_EXPORT
+  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
+
+  /// Set tool objects.
+  FEATURESAPI_EXPORT
+  void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Dump wrapped feature
+  FEATURESAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Boolean object.
+typedef std::shared_ptr<FeaturesAPI_BooleanFuse> BooleanFusePtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Boolean Fuse feature.
+FEATURESAPI_EXPORT
+BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                       const std::list<ModelHighAPI_Selection>& theObjects);
+
+/// \ingroup CPPHighAPI
+/// \brief Create Boolean Fuse feature.
+FEATURESAPI_EXPORT
+BooleanFusePtr addFuse(const std::shared_ptr<ModelAPI_Document>& thePart,
+                       const std::list<ModelHighAPI_Selection>& theMainObjects,
+                       const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+#endif // FeaturesAPI_BooleanFuse_H_
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp
new file mode 100644 (file)
index 0000000..7c7583b
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "FeaturesAPI_BooleanSmash.h"
+
+#include <ModelHighAPI_Dumper.h>
+#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<ModelHighAPI_Selection>& theMainObjects,
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+  if(initialize()) {
+    fillAttribute(theMainObjects, mymainObjects);
+    fillAttribute(theToolObjects, mytoolObjects);
+
+    execute(false);
+  }
+}
+
+//==================================================================================================
+FeaturesAPI_BooleanSmash::~FeaturesAPI_BooleanSmash()
+{
+}
+
+
+//==================================================================================================
+void FeaturesAPI_BooleanSmash::setMainObjects(
+  const std::list<ModelHighAPI_Selection>& theMainObjects)
+{
+  fillAttribute(theMainObjects, mymainObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanSmash::setToolObjects(
+  const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  fillAttribute(theToolObjects, mytoolObjects);
+
+  execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_BooleanSmash::dump(ModelHighAPI_Dumper& theDumper) const
+{
+  FeaturePtr aBase = feature();
+
+  theDumper << aBase << " = model.addSmash";
+
+  const std::string& aDocName = theDumper.name(aBase->document());
+  AttributeSelectionListPtr anObjects =
+    aBase->selectionList(FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID());
+  AttributeSelectionListPtr aTools =
+    aBase->selectionList(FeaturesPlugin_BooleanSmash::TOOL_LIST_ID());
+
+  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
+}
+
+//==================================================================================================
+BooleanSmashPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
+                         const std::list<ModelHighAPI_Selection>& theMainObjects,
+                         const std::list<ModelHighAPI_Selection>& theToolObjects)
+{
+  std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanSmash::ID());
+  return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature,
+                                                      theMainObjects,
+                                                      theToolObjects));
+}
diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanSmash.h b/src/FeaturesAPI/FeaturesAPI_BooleanSmash.h
new file mode 100644 (file)
index 0000000..bfe0d5e
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesAPI_BooleanSmash_H_
+#define FeaturesAPI_BooleanSmash_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_BooleanSmash.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Integer;
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_BooleanSmash
+/// \ingroup CPPHighAPI
+/// \brief Interface for Boolean Smash feature.
+class FeaturesAPI_BooleanSmash: public ModelHighAPI_Interface
+{
+public:
+  /// Constructor without values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_BooleanSmash(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  FeaturesAPI_BooleanSmash(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                           const std::list<ModelHighAPI_Selection>& theMainObjects,
+                           const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Destructor.
+  FEATURESAPI_EXPORT
+  virtual ~FeaturesAPI_BooleanSmash();
+
+  INTERFACE_2(FeaturesPlugin_BooleanSmash::ID(),
+              mainObjects, FeaturesPlugin_BooleanSmash::OBJECT_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Main objects */,
+              toolObjects, FeaturesPlugin_BooleanSmash::TOOL_LIST_ID(),
+              ModelAPI_AttributeSelectionList, /** Tool objects*/)
+
+  /// Set main objects.
+  FEATURESAPI_EXPORT
+  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
+
+  /// Set tool objects.
+  FEATURESAPI_EXPORT
+  void setToolObjects(const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+  /// Dump wrapped feature
+  FEATURESAPI_EXPORT
+  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
+};
+
+/// Pointer on Boolean object.
+typedef std::shared_ptr<FeaturesAPI_BooleanSmash> BooleanSmashPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Boolean Smash feature.
+FEATURESAPI_EXPORT
+BooleanSmashPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
+                         const std::list<ModelHighAPI_Selection>& theMainObjects,
+                         const std::list<ModelHighAPI_Selection>& theToolObjects);
+
+#endif // FeaturesAPI_BooleanSmash_H_
index a45b780ca99321045a6d45a2881e6da57641a75c..1c7d2d40b3d643e239f228543875246de580d1bd 100644 (file)
   #include <ModelHighAPI_swig.h>
 
   #include "FeaturesAPI.h"
-  #include "FeaturesAPI_Boolean.h"
+  #include "FeaturesAPI_BooleanCut.h"
+  #include "FeaturesAPI_BooleanFuse.h"
+  #include "FeaturesAPI_BooleanCommon.h"
+  #include "FeaturesAPI_BooleanSmash.h"
+  #include "FeaturesAPI_BooleanFill.h"
   #include "FeaturesAPI_Extrusion.h"
   #include "FeaturesAPI_ExtrusionBoolean.h"
   #include "FeaturesAPI_Fillet.h"
index ed5523231db41dedb98db313a44fbdac26acb69c..1f9d5df25aba2c2ea3f277038db3b4aba59d64c0 100644 (file)
@@ -30,6 +30,11 @@ SET(PROJECT_HEADERS
     FeaturesPlugin_Rotation.h
     FeaturesPlugin_Translation.h
     FeaturesPlugin_Boolean.h
+    FeaturesPlugin_BooleanCut.h
+    FeaturesPlugin_BooleanFuse.h
+    FeaturesPlugin_BooleanCommon.h
+    FeaturesPlugin_BooleanSmash.h
+    FeaturesPlugin_BooleanFill.h
     FeaturesPlugin_Intersection.h
     FeaturesPlugin_Partition.h
     FeaturesPlugin_Pipe.h
index 64072e62accc7b53a9543440a8e4cbe5483051db..7a765a11c74412b503e7a2a4f9235bd05dc85741 100644 (file)
 #include <map>
 
 //=================================================================================================
-FeaturesPlugin_Boolean::FeaturesPlugin_Boolean()
+FeaturesPlugin_Boolean::FeaturesPlugin_Boolean(const OperationType theOperationType)
+: myOperationType(theOperationType)
 {
 }
 
 //=================================================================================================
 void FeaturesPlugin_Boolean::initAttributes()
 {
-  data()->addAttribute(FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger::typeId());
-
   AttributeSelectionListPtr aSelection =
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
     FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
@@ -80,15 +79,14 @@ std::shared_ptr<GeomAPI_Shape> FeaturesPlugin_Boolean::getShape(const std::strin
 }
 
 //=================================================================================================
-void FeaturesPlugin_Boolean::execute()
+FeaturesPlugin_Boolean::OperationType FeaturesPlugin_Boolean::operationType()
 {
-  // Getting operation type.
-  std::shared_ptr<ModelAPI_AttributeInteger> aTypeAttr = std::dynamic_pointer_cast<
-      ModelAPI_AttributeInteger>(data()->attribute(FeaturesPlugin_Boolean::TYPE_ID()));
-  if (!aTypeAttr)
-    return;
-  OperationType aType = (FeaturesPlugin_Boolean::OperationType)aTypeAttr->value();
+  return myOperationType;
+}
 
+//=================================================================================================
+void FeaturesPlugin_Boolean::execute()
+{
   ListOfShape anObjects, aTools, anEdgesAndFaces, aPlanes;
   std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
 
@@ -118,7 +116,7 @@ void FeaturesPlugin_Boolean::execute()
         aCompSolidsObjects[aContextShape].push_back(anObject);
       }
     } else {
-      if(aType != BOOL_FILL
+      if(myOperationType != BOOL_FILL
         && (anObject->shapeType() == GeomAPI_Shape::EDGE
           || anObject->shapeType() == GeomAPI_Shape::FACE))
       {
@@ -141,7 +139,7 @@ void FeaturesPlugin_Boolean::execute()
       ResultPtr aContext = aToolAttr->context();
       aPlanes.push_back(aToolAttr->context()->shape());
     }
-    else if(aType != BOOL_FILL
+    else if (myOperationType != BOOL_FILL
       && (aTool->shapeType() == GeomAPI_Shape::EDGE
         || aTool->shapeType() == GeomAPI_Shape::FACE))
     {
@@ -153,7 +151,7 @@ void FeaturesPlugin_Boolean::execute()
 
   int aResultIndex = 0;
 
-  switch(aType) {
+  switch(myOperationType) {
     case BOOL_CUT:
     case BOOL_COMMON:
     case BOOL_FILL: {
@@ -174,7 +172,7 @@ void FeaturesPlugin_Boolean::execute()
         std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
         GeomShapePtr aResShape;
 
-        switch(aType) {
+        switch(myOperationType) {
           case BOOL_CUT: {
             aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aListWithObject,
                                                     aTools,
@@ -247,18 +245,19 @@ void FeaturesPlugin_Boolean::execute()
         aMakeShapeList.appendAlgo(aBoolAlgo);
 
         if(GeomAlgoAPI_ShapeTools::volume(aResShape) > 1.e-27
-          || (aType != BOOL_CUT && aType != BOOL_COMMON))
+           || (myOperationType != BOOL_CUT && myOperationType != BOOL_COMMON))
         {
           std::shared_ptr<ModelAPI_ResultBody> aResultBody =
             document()->createBody(data(), aResultIndex);
 
           ListOfShape aUsedTools = aTools;
-          if (aType == BOOL_FILL) {
+          if (myOperationType == BOOL_FILL) {
             aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end());
           }
 
           loadNamingDS(aResultBody, anObject, aUsedTools, aResShape,
-                       aMakeShapeList, *(aBoolAlgo->mapOfSubShapes()), aType == BOOL_FILL);
+                       aMakeShapeList, *(aBoolAlgo->mapOfSubShapes()),
+                       myOperationType == BOOL_FILL);
           setResult(aResultBody, aResultIndex);
           aResultIndex++;
         }
@@ -290,7 +289,7 @@ void FeaturesPlugin_Boolean::execute()
         GeomAlgoAPI_MakeShapeList aMakeShapeList;
         std::shared_ptr<GeomAlgoAPI_MakeShape> aBoolAlgo;
 
-        switch(aType) {
+        switch(myOperationType) {
           case BOOL_CUT: {
             aBoolAlgo.reset(new GeomAlgoAPI_Boolean(aUsedInOperationSolids,
                                                     aTools,
@@ -367,13 +366,13 @@ void FeaturesPlugin_Boolean::execute()
         }
 
         if(GeomAlgoAPI_ShapeTools::volume(aResultShape) > 1.e-27
-          || (aType != BOOL_CUT && aType != BOOL_COMMON))
+           || (myOperationType != BOOL_CUT && myOperationType != BOOL_COMMON))
         {
           std::shared_ptr<ModelAPI_ResultBody> aResultBody =
             document()->createBody(data(), aResultIndex);
 
           ListOfShape aUsedTools = aTools;
-          if (aType == BOOL_FILL) {
+          if (myOperationType == BOOL_FILL) {
             aUsedTools.insert(aUsedTools.end(), aPlanes.begin(), aPlanes.end());
           }
 
@@ -383,7 +382,7 @@ void FeaturesPlugin_Boolean::execute()
                        aResultShape,
                        aMakeShapeList,
                        aMapOfShapes,
-                       aType == BOOL_FILL);
+                       myOperationType == BOOL_FILL);
           setResult(aResultBody, aResultIndex);
           aResultIndex++;
         }
index d49820686883058d1991b778f8ab14a0f6c6ec4c..ce70e57bc619a23adb39ed2f23015eab795ec68b 100644 (file)
@@ -18,8 +18,8 @@
 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
-#ifndef FeaturesPlugin_Cut_H_
-#define FeaturesPlugin_Cut_H_
+#ifndef FeaturesPlugin_Boolean_H_
+#define FeaturesPlugin_Boolean_H_
 
 #include "FeaturesPlugin.h"
 
@@ -42,13 +42,6 @@ public:
     BOOL_SMASH
   };
 
-  /// Feature kind.
-  inline static const std::string& ID()
-  {
-    static const std::string MY_ID("Boolean");
-    return MY_ID;
-  }
-
   /// Attribute name of main objects.
   inline static const std::string& OBJECT_LIST_ID()
   {
@@ -63,19 +56,8 @@ public:
     return MY_TOOL_LIST_ID;
   }
 
-  /// Attribute name of operation type.
-  inline static const std::string& TYPE_ID()
-  {
-    static const std::string MY_TYPE_ID("bool_type");
-    return MY_TYPE_ID;
-  }
-
-  /// \return the kind of a feature.
-  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
-  {
-    static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
-    return MY_KIND;
-  }
+  /// \return boolean operation type.
+  FEATURESPLUGIN_EXPORT OperationType operationType();
 
   /// Creates a new part document if needed.
   FEATURESPLUGIN_EXPORT virtual void execute();
@@ -83,8 +65,10 @@ public:
   /// Request for initialization of data model of the feature: adding all attributes.
   FEATURESPLUGIN_EXPORT virtual void initAttributes();
 
+protected:
+
   /// Use plugin manager for features creation.
-  FeaturesPlugin_Boolean();
+  FeaturesPlugin_Boolean(const OperationType theOperationType);
 
 private:
   std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
@@ -97,6 +81,9 @@ private:
                     GeomAlgoAPI_MakeShape& theMakeShape,
                     GeomAPI_DataMapOfShapeShape& theMapOfShapes,
                     const bool theIsStoreAsGenerated = false);
+
+private:
+  OperationType myOperationType;
 };
 
 #endif
diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.h b/src/FeaturesPlugin/FeaturesPlugin_BooleanCommon.h
new file mode 100644 (file)
index 0000000..7acab2e
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesPlugin_BooleanCommon_H_
+#define FeaturesPlugin_BooleanCommon_H_
+
+#include "FeaturesPlugin_Boolean.h"
+
+/// \class FeaturesPlugin_BooleanCommon
+/// \ingroup Plugins
+/// \brief Feature for applying of Boolean Common operation.
+class FeaturesPlugin_BooleanCommon : public FeaturesPlugin_Boolean
+{
+public:
+
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_ID("Common");
+    return MY_ID;
+  }
+
+  /// \return the kind of a feature.
+  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = FeaturesPlugin_BooleanCommon::ID();
+    return MY_KIND;
+  }
+
+public:
+
+    /// Use plugin manager for features creation.
+  FeaturesPlugin_BooleanCommon(): FeaturesPlugin_Boolean(BOOL_COMMON) {};
+
+};
+
+#endif
diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.h b/src/FeaturesPlugin/FeaturesPlugin_BooleanCut.h
new file mode 100644 (file)
index 0000000..f53afa9
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesPlugin_BooleanCut_H_
+#define FeaturesPlugin_BooleanCut_H_
+
+#include "FeaturesPlugin_Boolean.h"
+
+/// \class FeaturesPlugin_BooleanCut
+/// \ingroup Plugins
+/// \brief Feature for applying of Boolean Cut operation.
+class FeaturesPlugin_BooleanCut : public FeaturesPlugin_Boolean
+{
+public:
+
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_ID("Cut");
+    return MY_ID;
+  }
+
+  /// \return the kind of a feature.
+  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = FeaturesPlugin_BooleanCut::ID();
+    return MY_KIND;
+  }
+
+public:
+
+    /// Use plugin manager for features creation.
+  FeaturesPlugin_BooleanCut(): FeaturesPlugin_Boolean(BOOL_CUT) {};
+
+};
+
+#endif
diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.h b/src/FeaturesPlugin/FeaturesPlugin_BooleanFill.h
new file mode 100644 (file)
index 0000000..b4cb73b
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesPlugin_BooleanFill_H_
+#define FeaturesPlugin_BooleanFill_H_
+
+#include "FeaturesPlugin_Boolean.h"
+
+/// \class FeaturesPlugin_BooleanFill
+/// \ingroup Plugins
+/// \brief Feature for applying of Boolean Fill operation.
+class FeaturesPlugin_BooleanFill : public FeaturesPlugin_Boolean
+{
+public:
+
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_ID("Fill");
+    return MY_ID;
+  }
+
+  /// \return the kind of a feature.
+  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = FeaturesPlugin_BooleanFill::ID();
+    return MY_KIND;
+  }
+
+public:
+
+    /// Use plugin manager for features creation.
+  FeaturesPlugin_BooleanFill(): FeaturesPlugin_Boolean(BOOL_FILL) {};
+
+};
+
+#endif
diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.h b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.h
new file mode 100644 (file)
index 0000000..bbd6216
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesPlugin_BooleanFuse_H_
+#define FeaturesPlugin_BooleanFuse_H_
+
+#include "FeaturesPlugin_Boolean.h"
+
+/// \class FeaturesPlugin_BooleanFuse
+/// \ingroup Plugins
+/// \brief Feature for applying of Boolean Fuse operation.
+class FeaturesPlugin_BooleanFuse : public FeaturesPlugin_Boolean
+{
+public:
+
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_ID("Fuse");
+    return MY_ID;
+  }
+
+  /// \return the kind of a feature.
+  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = FeaturesPlugin_BooleanFuse::ID();
+    return MY_KIND;
+  }
+
+public:
+
+    /// Use plugin manager for features creation.
+  FeaturesPlugin_BooleanFuse(): FeaturesPlugin_Boolean(BOOL_FUSE) {};
+
+};
+
+#endif
diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.h b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.h
new file mode 100644 (file)
index 0000000..86809f9
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FeaturesPlugin_BooleanSmash_H_
+#define FeaturesPlugin_BooleanSmash_H_
+
+#include "FeaturesPlugin_Boolean.h"
+
+/// \class FeaturesPlugin_BooleanSmash
+/// \ingroup Plugins
+/// \brief Feature for applying of Boolean Smash operation.
+class FeaturesPlugin_BooleanSmash : public FeaturesPlugin_Boolean
+{
+public:
+
+  /// Feature kind.
+  inline static const std::string& ID()
+  {
+    static const std::string MY_ID("Smash");
+    return MY_ID;
+  }
+
+  /// \return the kind of a feature.
+  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
+  {
+    static std::string MY_KIND = FeaturesPlugin_BooleanSmash::ID();
+    return MY_KIND;
+  }
+
+public:
+
+    /// Use plugin manager for features creation.
+  FeaturesPlugin_BooleanSmash(): FeaturesPlugin_Boolean(BOOL_SMASH) {};
+
+};
+
+#endif
index 2a8023433c763f1f06c3752987da571887980439..33f256c1ff88549e3098f90fc87f3fcea7159a76 100644 (file)
 
 #include <FeaturesPlugin_Plugin.h>
 
-#include <FeaturesPlugin_Boolean.h>
+#include <FeaturesPlugin_BooleanCut.h>
+#include <FeaturesPlugin_BooleanFuse.h>
+#include <FeaturesPlugin_BooleanCommon.h>
+#include <FeaturesPlugin_BooleanSmash.h>
+#include <FeaturesPlugin_BooleanFill.h>
 #include <FeaturesPlugin_Extrusion.h>
 #include <FeaturesPlugin_ExtrusionCut.h>
 #include <FeaturesPlugin_ExtrusionFuse.h>
@@ -90,6 +94,8 @@ FeaturesPlugin_Plugin::FeaturesPlugin_Plugin()
                               new FeaturesPlugin_ValidatorFilletSelection);
   aFactory->registerValidator("FeaturesPlugin_ValidatorCircular",
                               new FeaturesPlugin_ValidatorCircular);
+  aFactory->registerValidator("FeaturesPlugin_ValidatorBooleanArguments",
+                              new FeaturesPlugin_ValidatorBooleanArguments);
 
   // register this plugin
   ModelAPI_Session::get()->registerPlugin(this);
@@ -105,8 +111,16 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID)
     return FeaturePtr(new FeaturesPlugin_Rotation);
   } else if (theFeatureID == FeaturesPlugin_Translation::ID()) {
     return FeaturePtr(new FeaturesPlugin_Translation);
-  } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) {
-    return FeaturePtr(new FeaturesPlugin_Boolean);
+  } else if (theFeatureID == FeaturesPlugin_BooleanCut::ID()) {
+    return FeaturePtr(new FeaturesPlugin_BooleanCut);
+  } else if (theFeatureID == FeaturesPlugin_BooleanFuse::ID()) {
+    return FeaturePtr(new FeaturesPlugin_BooleanFuse);
+  } else if (theFeatureID == FeaturesPlugin_BooleanCommon::ID()) {
+    return FeaturePtr(new FeaturesPlugin_BooleanCommon);
+  } else if (theFeatureID == FeaturesPlugin_BooleanSmash::ID()) {
+    return FeaturePtr(new FeaturesPlugin_BooleanSmash);
+  } else if (theFeatureID == FeaturesPlugin_BooleanFill::ID()) {
+    return FeaturePtr(new FeaturesPlugin_BooleanFill);
   } else if (theFeatureID == FeaturesPlugin_Intersection::ID()) {
     return FeaturePtr(new FeaturesPlugin_Intersection);
   } else if (theFeatureID == FeaturesPlugin_Partition::ID()) {
index 5a06ceaaccb7c195ec89a83c589203d4162ca55a..0a85e1ab4418858699d50ece0707a7faac41a408 100644 (file)
@@ -571,8 +571,9 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt
       "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
     return false;
   }
-  FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
-  int anOperationType = aFeature->integer("bool_type")->value();
+  std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
+    std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theAttribute->owner());
+  FeaturesPlugin_Boolean::OperationType anOperationType = aFeature->operationType();
 
   for(int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
     AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
@@ -1016,3 +1017,137 @@ bool FeaturesPlugin_ValidatorCircular::isValid(const AttributePtr& theAttribute,
   }
   return isValid;
 }
+
+//=================================================================================================
+bool FeaturesPlugin_ValidatorBooleanArguments::isValid(
+  const std::shared_ptr<ModelAPI_Feature>& theFeature,
+  const std::list<std::string>& theArguments,
+  Events_InfoMessage& theError) const
+{
+  if (theArguments.size() != 2)
+  {
+    theError = "Wrong number of arguments (expected 2).";
+    return false;
+  }
+
+  int anObjectsNb = 0, aToolsNb = 0;
+  //int anOperationType = 0;
+
+  std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
+
+  bool isAllInSameCompSolid = true;
+  ResultCompSolidPtr aCompSolid;
+
+  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
+  if (anAttrSelList)
+  {
+    anObjectsNb = anAttrSelList->size();
+    for (int anIndex = 0; anIndex < anObjectsNb; ++anIndex)
+    {
+      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+      ResultPtr aContext = anAttr->context();
+      ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
+      if (aResCompSolidPtr.get())
+      {
+        if (aCompSolid.get())
+        {
+          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+        }
+        else
+        {
+          aCompSolid = aResCompSolidPtr;
+        }
+      }
+      else
+      {
+        isAllInSameCompSolid = false;
+        break;
+      }
+    }
+  }
+  anIt++;
+
+
+  anAttrSelList = theFeature->selectionList(*anIt);
+  if (anAttrSelList)
+  {
+    aToolsNb = anAttrSelList->size();
+    if (isAllInSameCompSolid)
+    {
+      for (int anIndex = 0; anIndex < aToolsNb; ++anIndex)
+      {
+        AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+        ResultPtr aContext = anAttr->context();
+        ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
+        if (aResCompSolidPtr.get())
+        {
+          if (aCompSolid.get())
+          {
+            isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+          }
+          else
+          {
+            aCompSolid = aResCompSolidPtr;
+          }
+        }
+        else
+        {
+          isAllInSameCompSolid = false;
+          break;
+        }
+      }
+    }
+  }
+  anIt++;
+
+  std::shared_ptr<FeaturesPlugin_Boolean> aFeature =
+    std::dynamic_pointer_cast<FeaturesPlugin_Boolean>(theFeature);
+  FeaturesPlugin_Boolean::OperationType anOperationType = aFeature->operationType();
+
+  if (anOperationType == FeaturesPlugin_Boolean::BOOL_FUSE)
+  {
+    // Fuse operation
+    if (anObjectsNb + aToolsNb < 2)
+    {
+      theError = "Not enough arguments for Fuse operation.";
+      return false;
+    }
+    else if (isAllInSameCompSolid)
+    {
+      theError = "Operations only between sub-shapes of the same shape not allowed.";
+      return false;
+    }
+  }
+  else
+  {
+    if (anObjectsNb < 1)
+    {
+      theError = "Objects not selected.";
+      return false;
+    }
+    if (aToolsNb < 1)
+    {
+      theError = "Tools not selected.";
+      return false;
+    }
+    if (isAllInSameCompSolid)
+    {
+      theError = "Operations only between sub-shapes of the same shape not allowed.";
+      return false;
+    }
+  }
+
+  return true;
+}
+
+//=================================================================================================
+bool FeaturesPlugin_ValidatorBooleanArguments::isNotObligatory(std::string theFeature,
+                                                               std::string theAttribute)
+{
+  if (theAttribute == "main_objects" || theAttribute == "tool_objects")
+  {
+    return true;
+  }
+
+  return false;
+}
index 5824ce9dc08753ffb46219711eae7e46bee418ff..c75ad9737149c250af28b9685118f34ecf7e8e0f 100644 (file)
@@ -267,4 +267,25 @@ public:
                        Events_InfoMessage& theError) const;
 };
 
+/** \class FeaturesPlugin_ValidatorBooleanArguments
+*  \ingroup Validators
+*  \brief Validates that boolean operation have enough arguments.
+*/
+class FeaturesPlugin_ValidatorBooleanArguments: public ModelAPI_FeatureValidator
+{
+public:
+  /** \brief Returns true if feature and/or attributes are valid.
+  *  \param[in] theFeature the validated feature.
+  *  \param[in] theArguments the arguments in the configuration file for this validator.
+  *  \param[out] theError error message.
+  *  \returns true if feature is valid.
+  */
+  virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                             const std::list<std::string>& theArguments,
+                                             Events_InfoMessage& theError) const;
+
+  /// \return true if the attribute in feature is not obligatory for the feature execution.
+  virtual bool isNotObligatory(std::string theFeature, std::string theAttribute);
+};
+
 #endif
index fc260d3309b9ea995759aa44a97db55d3337dcdf..d42a091f4bbae90c466733cbd0661411913bdc5e 100644 (file)
@@ -34,7 +34,7 @@ SketchCircle_3 = Sketch_2.addCircle(-41.97827733564338, 89.35676702647821, 6.102
 model.do()
 Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), 10, 0)
 Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")])
-Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Boolean_1_1_1/Modified_Face_1"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")])
+Group_1 = model.addGroup(Part_1_doc, [model.selection("FACE", "Extrusion_2_2/To_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_2/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Smash_1_1_1/Modified_Face_1"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_2/From_Face_1"), model.selection("FACE", "Extrusion_2_1/Generated_Face_1"), model.selection("FACE", "Extrusion_2_1/From_Face_1"), model.selection("FACE", "Extrusion_2_1/To_Face_1")])
 model.do()
 model.end()
 
index 16cb0352aac8b8ab30e4ebeb5572d6be94c9d217..1fbbd14c55c7ca53e434808b32df29144492f273 100644 (file)
@@ -206,15 +206,15 @@ SketchConstraintDistance_4 = Sketch_3.setDistance(SketchLine_21.startPoint(), Sk
 model.do()
 Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", "Sketch_3")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_13_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_14_2f")], model.selection(), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 0, model.selection(), 0)
-Boolean_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")])
-Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Boolean_1_1"), model.selection("SOLID", "Boolean_1_2")])
+Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")])
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Common_1_1"), model.selection("SOLID", "Common_1_2")])
 # skip 3 vertices, limitation
-Group_1_objects = [model.selection("VERTEX", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Boolean_2_1/Modified_Face_1"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5095"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("VERTEX", "ExtrusionCut_3_1/Lateral_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5108"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5082"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5069"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5043"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5024"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5006"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5015"), model.selection("VERTEX", "Extrusion_1_1/Lateral_4"), model.selection("VERTEX", "Extrusion_1_2/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5033"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5031"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5022"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5013"), model.selection("VERTEX", "Boolean_1_2/Modified_Face_2&Boolean_1_2/Modified_Face_1"), model.selection("VERTEX", "Boolean_1_1/Modified_Face_2&Boolean_1_1/Modified_Face_1")]
+Group_1_objects = [model.selection("VERTEX", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Cut_1_1/Modified_Face_1"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5095"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("VERTEX", "ExtrusionCut_3_1/Lateral_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5108"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5082"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5069"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5043"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5024"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5006"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5015"), model.selection("VERTEX", "Extrusion_1_1/Lateral_4"), model.selection("VERTEX", "Extrusion_1_2/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5033"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5031"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5022"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5013"), model.selection("VERTEX", "Common_1_2/Modified_Face_2&Common_1_2/Modified_Face_1"), model.selection("VERTEX", "Common_1_1/Modified_Face_2&Common_1_1/Modified_Face_1")]
 Group_1 = model.addGroup(Part_1_doc, Group_1_objects)
 # skip 3 edges, limitation
-Group_2_objects = [model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5011"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "Boolean_1_2/Modified_Face_2&Boolean_1_2/Modified_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&Boolean_1_2/Modified_Face_2"), model.selection("EDGE", "Boolean_1_2/Modified_Edge_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_9&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5002"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Boolean_1_1/Modified_Edge_1"), model.selection("EDGE", "Boolean_1_1/Modified_Face_2&Boolean_1_1/Modified_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&Boolean_1_1/Modified_Face_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5029"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5020")]
+Group_2_objects = [model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5011"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "Common_1_2/Modified_Face_2&Common_1_2/Modified_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&Common_1_2/Modified_Face_2"), model.selection("EDGE", "Common_1_2/Modified_Edge_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_9&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5002"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Common_1_1/Modified_Edge_1"), model.selection("EDGE", "Common_1_1/Modified_Face_2&Common_1_1/Modified_Face_1"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&Common_1_1/Modified_Face_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Cut_1_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5029"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8&Cut_1_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5020")]
 Group_2 = model.addGroup(Part_1_doc, Group_2_objects)
-Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"), model.selection("FACE", "Boolean_1_2/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_9"), model.selection("FACE", "Boolean_1_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Boolean_2_1/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_2"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_7"), model.selection("FACE", "Boolean_1_1/Modified_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Boolean_1_2/Modified_Face_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8")]
+Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"), model.selection("FACE", "Common_1_2/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_9"), model.selection("FACE", "Common_1_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Cut_1_1/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_2"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_7"), model.selection("FACE", "Common_1_1/Modified_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Common_1_2/Modified_Face_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8")]
 Group_3 = model.addGroup(Part_1_doc, Group_3_objects)
 model.end()
 
index e5e950d461fd67949e9c6fa70f8bf96f52ca3f3a..d3d2fde6c4949d8fc64839711bdfe8edd63c43c5 100644 (file)
@@ -85,10 +85,10 @@ SketchLine_9 = SketchProjection_4.createdFeature()
 SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_4.startPoint(), SketchLine_9.result())
 Extrusion_1.setNestedSketch(Sketch_2)
 
-Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
+Fill_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")])
 
 Point_2 = model.addPoint(Part_1_doc, "x", "y", "-z")
-Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Boolean_1_1_2/Modified_Face_3&Boolean_1_1_2/Modified_Face_2&Boolean_1_1_2/Modified_Face_1"))
+Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Fill_1_1_2/Modified_Face_3&Fill_1_1_2/Modified_Face_2&Fill_1_1_2/Modified_Face_1"))
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Point_1"), True)
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), "haut_ext_tuyau", True)
 Plane_5.result().setName("Plane_2 arrivee tuyau")
@@ -96,17 +96,17 @@ Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Gene
 Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"), 45)
 Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_4"), "90+45")
 
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Boolean_1_1_1")], [model.selection("FACE", "Plane_5")])
-Boolean_3 = model.addFill(Part_1_doc, [model.selection("SOLID", "Boolean_2_1_2")], [model.selection("FACE", "Plane_3")])
-Boolean_4 = model.addFill(Part_1_doc, [model.selection("SOLID", "Boolean_3_1_2")], [model.selection("FACE", "Plane_4")])
-Boolean_4.result().setColor(102, 51, 51)
-Boolean_4.result().subResult(0).setColor(153, 153, 76)
-Boolean_4.result().subResult(1).setColor(0, 204, 204)
-Boolean_4.result().subResult(2).setColor(51, 51, 102)
-Boolean_4.result().subResult(3).setColor(102, 204, 102)
-Boolean_4.result().subResult(4).setColor(204, 204, 0)
+Fill_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_1_1_1")], [model.selection("FACE", "Plane_5")])
+Fill_3 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_2_1_2")], [model.selection("FACE", "Plane_3")])
+Fill_4 = model.addFill(Part_1_doc, [model.selection("SOLID", "Fill_3_1_2")], [model.selection("FACE", "Plane_4")])
+Fill_4.result().setColor(102, 51, 51)
+Fill_4.result().subResult(0).setColor(153, 153, 76)
+Fill_4.result().subResult(1).setColor(0, 204, 204)
+Fill_4.result().subResult(2).setColor(51, 51, 102)
+Fill_4.result().subResult(3).setColor(102, 204, 102)
+Fill_4.result().subResult(4).setColor(204, 204, 0)
 
-Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Boolean_4_1_4"), model.selection("SOLID", "Boolean_4_1_2")])
+Union_1 = model.addUnion(Part_1_doc, [model.selection("SOLID", "Fill_4_1_4"), model.selection("SOLID", "Fill_4_1_2")])
 
 Point_3 = model.addPoint(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("FACE", "Plane_2 arrivee tuyau"))
 
@@ -170,33 +170,33 @@ model.do()
 
 Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_18"), 0, 180)
 
-Boolean_5 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], [model.selection("SOLID", "Extrusion_3_1")])
-Boolean_5.result().setName("demi-sphere")
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], [model.selection("SOLID", "Extrusion_3_1")])
+Cut_1.result().setName("demi-sphere")
 
 Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/From_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_10&Extrusion_2_1/To_Face_4"))
 Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_12&Extrusion_2_1/Generated_Face_11&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/From_Face_1"))
 Plane_11 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_3&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/To_Face_3"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_5&Extrusion_2_1/Generated_Face_7&Extrusion_2_1/From_Face_3"))
 Plane_12 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_1&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_4&Extrusion_2_1/From_Face_4"))
 
-Recover_1 = model.addRecover(Part_1_doc, Boolean_5, [Extrusion_3.result()])
+Recover_1 = model.addRecover(Part_1_doc, Cut_1, [Extrusion_3.result()])
 
 Plane_13 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape4"), model.selection("EDGE", "Recover_1_1/Shape4&Recover_1_1/Shape6"), "90+45")
 Plane_14 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape1"), model.selection("EDGE", "Recover_1_1/Shape1&Recover_1_1/Shape6"), "90+45")
 Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape2"), model.selection("EDGE", "Recover_1_1/Shape2&Recover_1_1/Shape6"), "90+45")
 Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape6"), model.selection("EDGE", "Recover_1_1/Shape3&Recover_1_1/Shape6"), 45)
 
-Boolean_6_objects_2 = [model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_7"), model.selection("FACE", "Plane_8"), model.selection("FACE", "Plane_9"), model.selection("FACE", "Plane_10"), model.selection("FACE", "Plane_11"), model.selection("FACE", "Plane_12"), model.selection("FACE", "Plane_13")]
-Boolean_6 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Boolean_6_objects_2)
+Fill_5_objects_2 = [model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_7"), model.selection("FACE", "Plane_8"), model.selection("FACE", "Plane_9"), model.selection("FACE", "Plane_10"), model.selection("FACE", "Plane_11"), model.selection("FACE", "Plane_12"), model.selection("FACE", "Plane_13")]
+Fill_5 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Fill_5_objects_2)
 
-Union_2_objects = [model.selection("SOLID", "Boolean_6_1_16"), model.selection("SOLID", "Boolean_6_1_13"), model.selection("SOLID", "Boolean_6_1_14")]
+Union_2_objects = [model.selection("SOLID", "Fill_5_1_16"), model.selection("SOLID", "Fill_5_1_13"), model.selection("SOLID", "Fill_5_1_14")]
 Union_2 = model.addUnion(Part_1_doc, Union_2_objects)
-Union_3_objects = [model.selection("SOLID", "Boolean_6_1_10/Boolean_6_1_10"), model.selection("SOLID", "Boolean_6_1_3/Boolean_6_1_3"), model.selection("SOLID", "Boolean_6_1_5/Boolean_6_1_5"), model.selection("SOLID", "Boolean_6_1_11/Boolean_6_1_11")]
+Union_3_objects = [model.selection("SOLID", "Fill_5_1_10/Fill_5_1_10"), model.selection("SOLID", "Fill_5_1_3/Fill_5_1_3"), model.selection("SOLID", "Fill_5_1_5/Fill_5_1_5"), model.selection("SOLID", "Fill_5_1_11/Fill_5_1_11")]
 Union_3 = model.addUnion(Part_1_doc, Union_3_objects)
-Union_4_objects = [model.selection("SOLID", "Boolean_6_1_12/Boolean_6_1_12"), model.selection("SOLID", "Boolean_6_1_6/Boolean_6_1_6"), model.selection("SOLID", "Boolean_6_1_4/Boolean_6_1_4")]
+Union_4_objects = [model.selection("SOLID", "Fill_5_1_12/Fill_5_1_12"), model.selection("SOLID", "Fill_5_1_6/Fill_5_1_6"), model.selection("SOLID", "Fill_5_1_4/Fill_5_1_4")]
 Union_4 = model.addUnion(Part_1_doc, Union_4_objects)
-Union_5_objects = [model.selection("SOLID", "Boolean_6_1_2/Boolean_6_1_2"), model.selection("SOLID", "Boolean_6_1_1/Boolean_6_1_1"), model.selection("SOLID", "Boolean_6_1_7/Boolean_6_1_7")]
+Union_5_objects = [model.selection("SOLID", "Fill_5_1_2/Fill_5_1_2"), model.selection("SOLID", "Fill_5_1_1/Fill_5_1_1"), model.selection("SOLID", "Fill_5_1_7/Fill_5_1_7")]
 Union_5 = model.addUnion(Part_1_doc, Union_5_objects)
-Union_6_objects = [model.selection("SOLID", "Boolean_6_1_8/Boolean_6_1_8"), model.selection("SOLID", "Boolean_6_1_9/Boolean_6_1_9"), model.selection("SOLID", "Boolean_6_1_15/Boolean_6_1_15")]
+Union_6_objects = [model.selection("SOLID", "Fill_5_1_8/Fill_5_1_8"), model.selection("SOLID", "Fill_5_1_9/Fill_5_1_9"), model.selection("SOLID", "Fill_5_1_15/Fill_5_1_15")]
 Union_6 = model.addUnion(Part_1_doc, Union_6_objects)
 Union_6.result().setColor(0, 0, 204)
 Union_6.result().subResult(0).setColor(204, 102, 102)
index 8398e133abcf9b1f9d664b7f9b08227c501aceb3..84c893e42829b58855d77b96d9f86c14683f756d 100644 (file)
@@ -124,11 +124,9 @@ aSession.finishOperation()
 # Create a pacman as boolean cut of the prism from the cylinder
 #=========================================================================
 aSession.startOperation()
-aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt = aPart.addFeature("Cut")
 aBooleanFt.selectionList("main_objects").append(extrudedObjects[0], extrudedObjects[0].shape())
 aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], extrudedObjects[1].shape())
-kBooleanTypeCut = 0
-aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
 aBooleanFt.execute()
 aSession.finishOperation()
 
index e2589d6d7a866c70635eb64e7279d21a6a6fedfe..aad16ba714d654c94eaffb02c514b836091c545f 100644 (file)
@@ -117,11 +117,9 @@ aSession.finishOperation()
 # Create a pacman as boolean cut of the prism from the cylinder
 #=========================================================================
 aSession.startOperation()
-aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt = aPart.addFeature("Cut")
 aBooleanFt.selectionList("main_objects").append(modelAPI_ResultCompSolid(extrudedObjects[0]).subResult(1), None)
 aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], None)
-aBooleanType = 0
-aBooleanFt.integer("bool_type").setValue(aBooleanType)
 aBooleanFt.execute()
 aSession.finishOperation()
 
@@ -134,11 +132,9 @@ aSession.undo()
 # Fuse
 #=========================================================================
 aSession.startOperation()
-aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt = aPart.addFeature("Fuse")
 aBooleanFt.selectionList("main_objects").append(modelAPI_ResultCompSolid(extrudedObjects[0]).subResult(1), None)
 aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], None)
-aBooleanType = 1
-aBooleanFt.integer("bool_type").setValue(aBooleanType)
 aBooleanFt.execute()
 aSession.finishOperation()
 
index 410c09da8731ba2813a88284f83cbeb3fdce1d91..4be9090f0e551b493dc458e67340fb9c5939cab5 100644 (file)
@@ -108,11 +108,9 @@ aSession.finishOperation()
 # Smash prism into the cylinder
 #=========================================================================
 aSession.startOperation()
-aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt = aPart.addFeature("Smash")
 aBooleanFt.selectionList("main_objects").append(extrudedObjects[0], extrudedObjects[0].shape())
 aBooleanFt.selectionList("tool_objects").append(extrudedObjects[1], extrudedObjects[1].shape())
-kBooleanTypeSmash = 3
-aBooleanFt.integer("bool_type").setValue(kBooleanTypeSmash)
 aBooleanFt.execute()
 aSession.finishOperation()
 
index 1fc541327b6952524415f0fde96c2c9da165ba6e..1f58f43bfa0533c5c7af70735e070048409f59d9 100644 (file)
@@ -52,7 +52,7 @@ model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift", True)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Boolean_1_1")], [model.selection("SOLID", "Box_1_1")])
+Boolean_2 = model.addFill(Part_1_doc, [model.selection("COMPOUND", "Fill_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
 model.checkBooleansResult(Boolean_2, model, 1, [6], [0], [6], [22], [44])
index c1e57f1d7a839b6a0e32bc1eb7f02f3a87ac5e52..07d7fcaa1289fc0126ae1151196899ce68253206 100644 (file)
@@ -52,7 +52,7 @@ model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift", True)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Boolean_1_1_2"), model.selection("FACE", "Boolean_1_1_1")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")])
 Boolean_2 = model.addFill(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], [model.selection("SOLID", "Box_1_1")])
 model.do()
 
index 759c501ad2c38f8ea6a0dad5017953ee886b3141..370f919adcc954a23ffb186c2dee1bbc16033693 100644 (file)
@@ -52,7 +52,7 @@ model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Boolean_1_1")])
+Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "Fill_1_1")])
 model.do()
 
 model.checkBooleansResult(Boolean_2, model, 1, [2], [2], [14], [60], [120])
index 8e965a51c815e37afdf8fc222f390dbbcec4cf80..ec7fe1163b257f1d4216ef748c99d0fd5623296f 100644 (file)
@@ -52,7 +52,7 @@ model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Boolean_1_1_2"), model.selection("FACE", "Boolean_1_1_1")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")])
 MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SHELL", "Shell_1_1")], model.selection("EDGE", "PartSet/OZ"), 1, 3)
 Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("COMPOUND", "LinearCopy_1_1")])
 model.do()
index 6cf9389d1c23c1e82813a54c984df7ebc5fc4e71..beb13ea39d4bf03d66b730ce494c2b34e00d7b83 100644 (file)
@@ -52,7 +52,7 @@ model.do()
 Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), "Shift/3", True)
 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchLine_2f-SketchLine_3f")])
 Boolean_1 = model.addFill(Part_1_doc, [model.selection("FACE", "Face_1_1")], [model.selection("FACE", "Plane_2")])
-Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Boolean_1_1_2"), model.selection("FACE", "Boolean_1_1_1")])
+Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Fill_1_1_2"), model.selection("FACE", "Fill_1_1_1")])
 Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Box_1_1")], [model.selection("SHELL", "Shell_1_1")])
 model.do()
 
index 6884e490e23ba5fa66b48d4ff15377927c2f3065..d332d786fc90cb259aa8e40e66976b007a36984e 100644 (file)
@@ -114,7 +114,7 @@ for i in xrange(0, N * N):
     anExtrusionFt.real("from_size").setValue(0)
     anExtrusionFt.real("to_size").setValue(10)
     anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove        
+    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
     # v1.0.2 from master
     # anExtrusionFt.selection("extrusion_face").setValue(
     #    aSketchResult, aSketchFaces[0])
@@ -194,13 +194,11 @@ aSession.finishOperation()
 aCurrentResult = modelAPI_ResultBody(aBox.firstResult())
 aSession.startOperation()
 
-aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt = aPart.addFeature("Cut")
 aBooleanFt.selectionList("main_objects").append(aCurrentResult, aCurrentResult.shape())
 for i in xrange(0, N * N):
     anExtrusionResult = modelAPI_ResultBody(anExtrusions[i].firstResult())
     aBooleanFt.selectionList("tool_objects").append(anExtrusionResult, anExtrusionResult.shape())
-kBooleanTypeCut = 0
-aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
 aBooleanFt.execute()
 aFactory = ModelAPI_Session.get().validators()
 assert (aFactory.validate(aBooleanFt))
index c7361d2741bbdec4b397e1e07dc9108640cdf5e2..08f4887d07488c6f1f049f4ceadef476e6623d10 100644 (file)
@@ -114,7 +114,7 @@ for i in xrange(0, N * N):
     anExtrusionFt.real("from_size").setValue(0)
     anExtrusionFt.real("to_size").setValue(10)
     anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
-    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove        
+    anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
     # v1.0.2 from master
     # anExtrusionFt.selection("extrusion_face").setValue(
     #    aSketchResult, aSketchFaces[0])
@@ -197,11 +197,9 @@ aSession.startOperation()
 aFactory = ModelAPI_Session.get().validators()
 for i in xrange(0, N * N):
     anExtrusionResult = modelAPI_ResultBody(anExtrusions[i].firstResult())
-    aBooleanFt = aPart.addFeature("Boolean")
+    aBooleanFt = aPart.addFeature("Cut")
     aBooleanFt.selectionList("main_objects").append(aCurrentResult, aCurrentResult.shape())
     aBooleanFt.selectionList("tool_objects").append(anExtrusionResult, anExtrusionResult.shape())
-    kBooleanTypeCut = 0
-    aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
     aBooleanFt.execute()
     assert (aFactory.validate(aBooleanFt))
     assert (len(aBooleanFt.results()) > 0)
index 015c1d0e5ecf409bcd4ed3915749fcdbdb73aca3..888ccf8031afb6f104b03bee7a39f200b1d1d4f0 100644 (file)
@@ -20,16 +20,6 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
 -->
 
 <source>
-  <module_choice id="bool_type"
-    widget_type="radiobuttons"
-    buttons_dir="horizontal"
-    label="Operation type"
-    tooltip="Type of boolean operation"
-    string_list="Cut Fuse Common Fill Smash"
-    use_in_title="true"
-    icons_list="icons/Features/bool_cut.png icons/Features/bool_fuse.png icons/Features/bool_common.png icons/Features/bool_fill.png icons/Features/bool_smash.png"
-    default="0"
-  />
   <multi_selector id="main_objects"
     label="Main objects"
     icon=""
@@ -50,5 +40,5 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     <validator id="PartSet_DifferentObjects"/>
     <validator id="FeaturesPlugin_ValidatorBooleanSelection"/>
   </multi_selector>
-  <validator id="GeomValidators_BooleanArguments" parameters="main_objects,tool_objects,bool_type"/>
+  <validator id="FeaturesPlugin_ValidatorBooleanArguments" parameters="main_objects,tool_objects"/>
 </source>
index 5a4ac2f526988d246b6aabdc8b5d399e16203bfa..09969318043a3e5a57c5bf4cb58792257c019655 100644 (file)
@@ -54,7 +54,19 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
       </feature>
     </group>
     <group id="Boolean">
-      <feature id="Boolean" title="Boolean" tooltip="Perform boolean operations with objects" icon="icons/Features/cut.png"
+      <feature id="Cut" title="Cut" tooltip="Perform boolean cut operation with objects" icon="icons/Features/bool_cut.png"
+               auto_preview="false">
+          <source path="boolean_widget.xml"/>
+      </feature>
+      <feature id="Fuse" title="Fuse" tooltip="Perform boolean fuse operation with objects" icon="icons/Features/bool_fuse.png"
+               auto_preview="false">
+          <source path="boolean_widget.xml"/>
+      </feature>
+      <feature id="Common" title="Common" tooltip="Perform boolean common operation with objects" icon="icons/Features/bool_common.png"
+               auto_preview="false">
+          <source path="boolean_widget.xml"/>
+      </feature>
+      <feature id="Smash" title="Smash" tooltip="Perform boolean smash operation with objects" icon="icons/Features/bool_smash.png"
                auto_preview="false">
           <source path="boolean_widget.xml"/>
       </feature>
@@ -65,6 +77,10 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
                auto_preview="false">
           <source path="partition_widget.xml"/>
       </feature>
+      <feature id="Fill" title="Fill" tooltip="Perform boolean fill operation with objects" icon="icons/Features/bool_fill.png"
+               auto_preview="false">
+          <source path="boolean_widget.xml"/>
+      </feature>
       <feature id="Union" title="Union" tooltip="Perform union operations with shapes" icon="icons/Features/union.png">
           <source path="union_widget.xml"/>
       </feature>
index 3b343b2926f792021ec168c46ce8dc59e0c782ea..f8cb4d1e60b1460edb7298ea2bce86b08d1a9ff2 100644 (file)
@@ -23,7 +23,6 @@ INCLUDE(Common)
 SET(PROJECT_HEADERS
     GeomValidators.h
     GeomValidators_BodyShapes.h
-    GeomValidators_BooleanArguments.h
     GeomValidators_ConstructionComposite.h
     GeomValidators_DifferentShapes.h
     GeomValidators_Face.h
@@ -43,7 +42,6 @@ SET(PROJECT_HEADERS
 
 SET(PROJECT_SOURCES
     GeomValidators_BodyShapes.cpp
-    GeomValidators_BooleanArguments.cpp
     GeomValidators_ConstructionComposite.cpp
     GeomValidators_DifferentShapes.cpp
     GeomValidators_Face.cpp
diff --git a/src/GeomValidators/GeomValidators_BooleanArguments.cpp b/src/GeomValidators/GeomValidators_BooleanArguments.cpp
deleted file mode 100644 (file)
index 7c16a62..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
-//
-
-#include <GeomValidators_BooleanArguments.h>
-
-#include <Events_InfoMessage.h>
-
-#include <ModelAPI_AttributeInteger.h>
-#include <ModelAPI_AttributeSelectionList.h>
-#include <ModelAPI_ResultCompSolid.h>
-#include <ModelAPI_Tools.h>
-
-//=================================================================================================
-bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                              const std::list<std::string>& theArguments,
-                                              Events_InfoMessage& theError) const
-{
-  if(theArguments.size() != 3) {
-    theError = "Wrong number of arguments (expected 3).";
-    return false;
-  }
-
-  int anObjectsNb = 0, aToolsNb = 0;
-  int anOperationType = 0;
-
-  std::list<std::string>::const_iterator anIt = theArguments.begin(), aLast = theArguments.end();
-
-  bool isAllInSameCompSolid = true;
-  ResultCompSolidPtr aCompSolid;
-
-  AttributeSelectionListPtr anAttrSelList = theFeature->selectionList(*anIt);
-  if(anAttrSelList) {
-    anObjectsNb = anAttrSelList->size();
-    for(int anIndex = 0; anIndex < anObjectsNb; ++anIndex) {
-      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-      ResultPtr aContext = anAttr->context();
-      ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
-      if(aResCompSolidPtr.get()) {
-        if(aCompSolid.get()) {
-          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
-        } else {
-          aCompSolid = aResCompSolidPtr;
-        }
-      } else {
-        isAllInSameCompSolid = false;
-        break;
-      }
-    }
-  }
-  anIt++;
-
-
-  anAttrSelList = theFeature->selectionList(*anIt);
-  if(anAttrSelList) {
-    aToolsNb = anAttrSelList->size();
-    if(isAllInSameCompSolid) {
-      for(int anIndex = 0; anIndex < aToolsNb; ++anIndex) {
-        AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-        ResultPtr aContext = anAttr->context();
-        ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
-        if(aResCompSolidPtr.get()) {
-          if(aCompSolid.get()) {
-            isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
-          } else {
-            aCompSolid = aResCompSolidPtr;
-          }
-        } else {
-          isAllInSameCompSolid = false;
-          break;
-        }
-      }
-    }
-  }
-  anIt++;
-
-  std::shared_ptr<ModelAPI_AttributeInteger> anAttrInt = theFeature->integer(*anIt);
-  if(anAttrInt) {
-    anOperationType = anAttrInt->value();
-  }
-
-  if(anOperationType == 1) {
-    // Fuse operation
-    if(anObjectsNb + aToolsNb < 2) {
-      theError = "Not enough arguments for Fuse operation.";
-      return false;
-    } else if(isAllInSameCompSolid) {
-      theError = "Operations only between sub-shapes of the same shape not allowed.";
-      return false;
-    }
-  } else {
-    if(anObjectsNb < 1) {
-      theError = "Objects not selected.";
-      return false;
-    }
-    if(aToolsNb < 1) {
-      theError = "Tools not selected.";
-      return false;
-    }
-    if(isAllInSameCompSolid) {
-      theError = "Operations only between sub-shapes of the same shape not allowed.";
-      return false;
-    }
-  }
-
-  return true;
-}
-
-//=================================================================================================
-bool GeomValidators_BooleanArguments::isNotObligatory(std::string theFeature,
-                                                      std::string theAttribute)
-{
-  if(theAttribute == "main_objects" || theAttribute == "tool_objects") {
-    return true;
-  }
-
-  return false;
-}
diff --git a/src/GeomValidators/GeomValidators_BooleanArguments.h b/src/GeomValidators/GeomValidators_BooleanArguments.h
deleted file mode 100644 (file)
index a246b42..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef GeomValidators_BooleanArguments_H
-#define GeomValidators_BooleanArguments_H
-
-#include <GeomValidators.h>
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_FeatureValidator.h>
-
-/** \class GeomValidators_BooleanArguments
- *  \ingroup Validators
- *  \brief Validates that boolean operation have enough arguments.
- */
-class GeomValidators_BooleanArguments : public ModelAPI_FeatureValidator
-{
-public:
-  /** \brief Returns true if feature and/or attributes are valid.
-   *  \param[in] theFeature the validated feature.
-   *  \param[in] theArguments the arguments in the configuration file for this validator.
-   *  \param[out] theError error message.
-   *  \returns true if feature is valid.
-   */
-  GEOMVALIDATORS_EXPORT virtual bool isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                             const std::list<std::string>& theArguments,
-                                             Events_InfoMessage& theError) const;
-
-  /// \return true if the attribute in feature is not obligatory for the feature execution.
-  GEOMVALIDATORS_EXPORT virtual
-    bool isNotObligatory(std::string theFeature, std::string theAttribute);
-};
-
-#endif
index 54ee61429f09e152bde94df11b0c9ebfb27b25d8..2f80b49952b5b3d1df59e5d1362962a57bffa17f 100644 (file)
@@ -21,7 +21,6 @@
 #include <GeomValidators_Plugin.h>
 
 #include <GeomValidators_BodyShapes.h>
-#include <GeomValidators_BooleanArguments.h>
 #include <GeomValidators_ConstructionComposite.h>
 #include <GeomValidators_Different.h>
 #include <GeomValidators_DifferentShapes.h>
@@ -47,8 +46,6 @@ GeomValidators_Plugin::GeomValidators_Plugin()
   ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
 
   aFactory->registerValidator("GeomValidators_BodyShapes", new GeomValidators_BodyShapes);
-  aFactory->registerValidator("GeomValidators_BooleanArguments",
-                              new GeomValidators_BooleanArguments);
   aFactory->registerValidator("GeomValidators_ConstructionComposite",
                               new GeomValidators_ConstructionComposite);
   aFactory->registerValidator("GeomValidators_Different", new GeomValidators_Different);
index 9afa65d1cc9c435201da180102fa89834a59b346..4a3be33be3ea5e00b83971b5a256d466aa2e8b82 100755 (executable)
@@ -104,10 +104,9 @@ aSession.finishOperation()
 # Do cut a hole from a box
 #=========================================================================
 aSession.startOperation()
-aCut1 = aPart.addFeature("Boolean")
+aCut1 = aPart.addFeature("Cut")
 aCut1.selectionList("main_objects").append(aBox.firstResult(), None)
 aCut1.selectionList("tool_objects").append(aHoleExt.firstResult(), None)
-aCut1.integer("bool_type").setValue(0) # cut
 aSession.finishOperation()
 
 #=========================================================================
@@ -136,10 +135,9 @@ aSession.finishOperation()
 # Do fuse with a tower. Tower must be an argument (not tool) to add the problem to the faces owners detection.
 #=========================================================================
 aSession.startOperation()
-aFuse = aPart.addFeature("Boolean")
+aFuse = aPart.addFeature("Fuse")
 aFuse.selectionList("main_objects").append(aTower.firstResult(), None)
 aFuse.selectionList("tool_objects").append(aCut1.firstResult(), None)
-aFuse.integer("bool_type").setValue(1) # fuse
 aSession.finishOperation()
 
 #=========================================================================
@@ -156,12 +154,12 @@ def check_owner(selection, topology_type, feature):
 
 # check faces
 check_owner("Extrusion_1_1/Generated_Face_1", "face", aBox)
-check_owner("Boolean_2_1/Modified_Face_3", "face", aBox)
-check_owner("Boolean_1_1/Modified_Face_1", "face", aHoleExt)
-check_owner("Boolean_2_1/Modified_Face_1", "face", aTower)
+check_owner("Fuse_1_1/Modified_Face_3", "face", aBox)
+check_owner("Cut_1_1/Modified_Face_1", "face", aHoleExt)
+check_owner("Fuse_1_1/Modified_Face_1", "face", aTower)
 # check edges without ambiguity
-check_owner("Boolean_2_1/Modified_Face_2&Extrusion_1_1/Generated_Face_2", "edge", aBox)
-check_owner("Boolean_2_1/Modified_Face_1&Extrusion_3_1/To_Face_1_1", "edge", aTower)
+check_owner("Fuse_1_1/Modified_Face_2&Extrusion_1_1/Generated_Face_2", "edge", aBox)
+check_owner("Fuse_1_1/Modified_Face_1&Extrusion_3_1/To_Face_1_1", "edge", aTower)
 
 # check the connected topology method: solid is not a compound of connected topology
 assert(aFuse.firstResult().shape().isConnectedTopology() == False)
index 666faafe6201e4475e107743f0fea6cb39750f72..46c17b094fdf603ae178e0e6e6b1f0a6b055d24c 100644 (file)
@@ -57,7 +57,7 @@ model.do()
 Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_2/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_3"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_4"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_1")])
 Extrusion_4 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_2_2f")], model.selection(), model.selection("FACE", "Extrusion_2_1/From_Face_1"), 0, model.selection(), 0)
 Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_4_1")])
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Boolean_1_1"), model.selection("SOLID", "Boolean_2_1"), model.selection("FACE", "Face_1_1")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Cut_2_1"), model.selection("FACE", "Face_1_1")])
 Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPOUND", "Partition_1_1"))
 Remove_SubShapes_1.setSubShapesToKeep([model.selection("COMPSOLID", "Partition_1_1_1")])
 model.end()