Salome HOME
0022471: EDF 2604 GEOM: Suppress the boundary edges of the tools in the fuse operation
authorskv <skv@opencascade.com>
Thu, 27 Mar 2014 07:59:05 +0000 (11:59 +0400)
committerskv <skv@opencascade.com>
Thu, 27 Mar 2014 07:59:05 +0000 (11:59 +0400)
14 files changed:
doc/salome/gui/GEOM/images/bool1.png
doc/salome/gui/GEOM/input/fuse_operation.doc
doc/salome/gui/GEOM/input/using_boolean_operations.doc
idl/GEOM_Gen.idl
src/BooleanGUI/BooleanGUI_Dialog.cxx
src/BooleanGUI/BooleanGUI_Dialog.h
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx
src/GEOMImpl/GEOMImpl_IBoolean.hxx
src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx
src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx
src/GEOM_I/GEOM_IBooleanOperations_i.cc
src/GEOM_I/GEOM_IBooleanOperations_i.hh
src/GEOM_SWIG/geomBuilder.py

index cc89563870ceffd760b42ae11822dbe546b1e491..c259c3fcc4a4d628486fae165d135e3d8943bf14 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/bool1.png and b/doc/salome/gui/GEOM/images/bool1.png differ
index 95dc6ce06954869fa6cd63f53b8125e8049c15f9..e0a31b777c2a457f41675b66fbc0525bf8ee1495 100644 (file)
@@ -12,6 +12,7 @@ In this dialog:
 - Input or accept the default \b Name of the resulting shape. 
 - Click the arrow button and select in the Object Browser or in the Viewer the <b>Objects</b> to be fused.
 - Activate the corresponding check-box if you wish to <b> Detect Self-intersections </b>.
+- Activate the corresponding check-box if you wish to <b> remove extra edges </b>.
 - Activate \ref restore_presentation_parameters_page "Advanced options" if required.
 - Press "Apply" or "Apply & Close" button to get the result (GEOM_Object).
 
@@ -24,15 +25,17 @@ In this dialog:
  
 This operation can be performed using a <b>TUI Command:</b> 
 
-<em>geompy.MakeFuseList(theShapesList, checkSelfInte)</em>
+<em>geompy.MakeFuseList(theShapesList, checkSelfInte, rmExtraEdges)</em>
 
-<b>Arguments:</b> Name + a list of shapes + an optional flag for self-intersection check.
+<b>Arguments:</b> Name + a list of shapes + an optional flag for
+self-intersection check + an optional flag to remove extra edges.
 
 There is also a special <b>TUI Command</b> for \b Fuse operation on two shapes  :
 
-<em>geompy.MakeFuse(s1, s2, checkSelfInte)</em>
+<em>geompy.MakeFuse(s1, s2, checkSelfInte, rmExtraEdges)</em>
 
-<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection check.
+<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection
+check + an optional flag to remove extra edges.
 
 <b>Example:</b>
 
index 74acd1e8b20ab6d10730e72f9610488c9c7762ce..02a30251d246b12be9d52b9451f964e300c99f73 100644 (file)
@@ -23,7 +23,7 @@ a list of others. </li>
 You can use advanced TUI commands performing these operations
 independently from each other:
 \par
-<em>geompy.MakeFuseList(theShapesList, checkSelfInte)</em>, where \em theShapesList is
+<em>geompy.MakeFuseList(theShapesList, checkSelfInte, rmExtraEdges)</em>, where \em theShapesList is
 the list of shapes for Fuse operation; 
 \par
 <em>geompy.MakeCommonList(theShapesList, checkSelfInte)</em>, where \em theShapesList is
@@ -51,7 +51,7 @@ a Boolean operation, \em Operation is the type of a Boolean operation (1
 Besides, you can use advanced TUI commands performing these operations
 independently from each other:
 \par
-<em>geompy.MakeFuse(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
+<em>geompy.MakeFuse(Shape1, Shape2, checkSelfInte, rmExtraEdges)</em>, where \em Shape1 is the first
 argument and \em Shape2 is the second argument of Fuse operation; 
 \par
 <em>geompy.MakeCommon(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
@@ -73,6 +73,17 @@ not valid for boolean operations.
       all self-intersections use \ref check_self_intersections_page
       "Detect Self-intersection tool".
 
+The flag \em rmExtraEdges is used for \em MakeFuseList and \em MakeFuse
+operations only. It indicates if Remove Extra Edges operation should be
+performed during the operation. Its default value is \em False, which
+means that there is no need to do it.
+
+\note \em rmExtraEdges is not available for \em MakeBoolean call with
+      operation type 3 (Fuse). \em MakeBoolean operation doesn't perform
+      Remove Extra Edges. So the call <em>geompy.MakeBoolean(Shape1, Shape2,
+      3, checkSelfInte)</em> is equivalent to <em>geompy.MakeFuse(Shape1,
+      Shape2, checkSelfInte, False)</em>.
+
 Our <b>TUI Scripts</b> provide you with useful examples of the use of 
 \ref tui_boolean_operations_page "Boolean Operations".
 
index 921e359955eddb48b638d2006badd4901b281a0f..542a1e8e8defdbc6ed2f3ffadfbcb0dd71df4ef2 100644 (file)
@@ -2917,16 +2917,33 @@ module GEOM
                              in GEOM_Object theShape2,
                              in long        theOperation,
                              in boolean     IsCheckSelfInte);
+    /*!
+     *  \brief Perform fusion boolean operation on two given shapes.
+     *  \param theShape1 First argument for fuse operation.
+     *  \param theShape2 Second argument for fuse operation.
+     *  \param IsCheckSelfInte If TRUE, perform check self intersection
+     *                         of arguments before an operation.
+     *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
+     *                        during an operation.
+     *  \return New GEOM_Object, containing the result shape.
+     */
+    GEOM_Object MakeFuse (in GEOM_Object theShape1,
+                          in GEOM_Object theShape2,
+                          in boolean     IsCheckSelfInte,
+                          in boolean     IsRmExtraEdges);
 
     /*!
      *  \brief Perform fusion boolean operation on list of objects.
      *  \param theShapes Shapes to be fused.
      *  \param IsCheckSelfInte If TRUE, perform check self intersection
      *                         of arguments before an operation.
+     *  \param IsRmExtraEdges If TRUE, perform removal of extra edges
+     *                        during an operation.
      *  \return New GEOM_Object, containing the result shape.
      */
     GEOM_Object MakeFuseList (in ListOfGO theShapes,
-                              in boolean  IsCheckSelfInte);
+                              in boolean  IsCheckSelfInte,
+                              in boolean  IsRmExtraEdges);
 
     /*!
      *  \brief Perform common boolean operation on list of objects.
index 3b57da1ca59f884475f88a9e99db0a2029e8a3ba..3ee6ba47c2aa31eba07019d3cc8eeced8484c011 100644 (file)
@@ -93,7 +93,7 @@ BooleanGUI_Dialog::BooleanGUI_Dialog (const int theOperation, GeometryGUI* theGe
   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
   mainFrame()->RadioButton3->close();
 
-  myGroup = new DlgRef_2Sel2Spin1Check(centralWidget());
+  myGroup = new DlgRef_2Sel2Spin3Check(centralWidget());
 
   myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
   if (myOperation == BooleanGUI::CUT) {
@@ -108,21 +108,30 @@ BooleanGUI_Dialog::BooleanGUI_Dialog (const int theOperation, GeometryGUI* theGe
     myGroup->TextLabel2->hide();
     myGroup->PushButton2->hide();
     myGroup->LineEdit2->hide();
+
+    if (myOperation == BooleanGUI::FUSE) {
+      myGroup->CheckBox2->setText(tr("GEOM_BOOL_REMOVE_EXTRA_EDGES"));
+    }
   }
 
   myGroup->PushButton1->setIcon(image1);
   myGroup->LineEdit1->setReadOnly(true);
 
-  if (myOperation != BooleanGUI::FUSE && myOperation != BooleanGUI::COMMON) {
-    myGroup->PushButton2->setIcon(image1);
-    myGroup->LineEdit2->setReadOnly(true);
+  if (myOperation != BooleanGUI::FUSE) {
+    myGroup->CheckBox2->hide();
+
+    if (myOperation != BooleanGUI::COMMON) {
+      myGroup->PushButton2->setIcon(image1);
+      myGroup->LineEdit2->setReadOnly(true);
+    }
   }
 
   myGroup->TextLabel3->hide();
   myGroup->TextLabel4->hide();
   myGroup->SpinBox_DX->hide();
   myGroup->SpinBox_DY->hide();
-  myGroup->CheckButton1->setText(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
+  myGroup->CheckBox3->hide();
+  myGroup->CheckBox1->setText(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -158,7 +167,12 @@ void BooleanGUI_Dialog::Init()
 
   myGroup->LineEdit1->setText("");
   myGroup->LineEdit2->setText("");
-  myGroup->CheckButton1->setChecked(true);
+  myGroup->CheckBox1->setChecked(true);
+
+  if (myOperation == BooleanGUI::FUSE) {
+    myGroup->CheckBox2->setChecked(true);
+  }
+
   myObject1.nullify();
   reset();
  
@@ -409,11 +423,16 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects)
   GEOM::GEOM_Object_var anObj;
 
   GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
-  const bool isCheckSelfInte = myGroup->CheckButton1->isChecked();
+  const bool isCheckSelfInte = myGroup->CheckBox1->isChecked();
 
   switch (myOperation) {
     case BooleanGUI::FUSE:
-      anObj = anOper->MakeFuseList(myObjects, isCheckSelfInte);
+      {
+        const bool isRmExtraEdges = myGroup->CheckBox2->isChecked();
+
+        anObj = anOper->MakeFuseList
+          (myObjects, isCheckSelfInte, isRmExtraEdges);
+      }
     break;
     case BooleanGUI::COMMON:
       anObj = anOper->MakeCommonList(myObjects, isCheckSelfInte);
index f7726a72cc3c6b2ac2c9a81098c7f8f4ef3c11a3..99ead05a6915a5751f31e79cf08a42d4a5446331 100644 (file)
@@ -30,7 +30,7 @@
 #include "GEOMBase_Skeleton.h"
 #include "GEOM_GenericObjPtr.h"
 
-class DlgRef_2Sel2Spin1Check;
+class DlgRef_2Sel2Spin3Check;
 
 //=================================================================================
 // class    : BooleanGUI_Dialog
@@ -65,7 +65,7 @@ private:
   GEOM::GeomObjPtr                   myObject1;
   GEOM::ListOfGO_var                 myObjects;
   
-  DlgRef_2Sel2Spin1Check*            myGroup;
+  DlgRef_2Sel2Spin3Check*            myGroup;
 
 private slots:
   void                               ClickOnOk();
index d57c18ef59f289ac1466fbe6043b39b189dfbbf2..35cf49d7f48af55d34cf9b3d97901f9df53d039d 100644 (file)
@@ -4640,6 +4640,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_REMOVE_EXTRA_EDGES_TITLE</source>
         <translation>Remove extra edges</translation>
     </message>
+    <message>
+        <source>GEOM_BOOL_REMOVE_EXTRA_EDGES</source>
+        <translation>Remove extra edges</translation>
+    </message>
     <message>
         <source>GEOM_REMOVE_EXTRA_EDGES</source>
         <translation>Object to remove extra edges</translation>
index 99c2ab976d7990f31957621fab442ef514fa2ac0..32b0b04fa21b02af7d5861013d0b7f0e8a5dadd5 100644 (file)
@@ -26,6 +26,8 @@
 #include <GEOMImpl_GlueDriver.hxx>
 #include <GEOM_Function.hxx>
 #include <GEOMUtils.hxx>
+#include <BlockFix_BlockFixAPI.hxx>
+#include <ShHealOper_ShapeProcess.hxx>
 
 #include <TNaming_CopyShape.hxx>
 
 // here check level is decreased to more appropriate value to avoid problems with performance).
 #define BOP_SELF_INTERSECTIONS_LEVEL 4
 
+/**
+ * This function performs extra edges removal.
+ *
+ * \param theShape the shape to be processed.
+ * \return the modified shape or null shape in case of failure.
+ */
+static TopoDS_Shape RemoveExtraEdges(const TopoDS_Shape &theShape)
+{
+  TopoDS_Shape aResult;
+
+  if (theShape.IsNull() == Standard_False) {
+    BlockFix_BlockFixAPI aTool;
+
+    aTool.OptimumNbFaces() = 0;
+    aTool.SetShape(theShape);
+    aTool.Perform();
+    aResult = aTool.Shape();
+
+    // Repair result
+    BRepCheck_Analyzer anAna (aResult, false);
+    Standard_Boolean isValid = anAna.IsValid();
+
+    if (!isValid) {
+      TopoDS_Shape aFixed;
+      ShHealOper_ShapeProcess aHealer;
+
+      aHealer.Perform(aResult, aFixed);
+
+      if (aHealer.isDone()) {
+        aResult = aFixed;
+        anAna.Init(aResult, false);
+        isValid = anAna.IsValid();
+      }
+    }
+
+    if (!isValid) {
+      aResult.Nullify();
+    }
+  }
+
+  return aResult;
+}
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -91,6 +136,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
   GEOMImpl_IBoolean aCI (aFunction);
   Standard_Integer aType = aFunction->GetType();
   const Standard_Boolean isCheckSelfInte = aCI.GetCheckSelfIntersection();
+  const Standard_Boolean isRmExtraEdges  = aCI.GetRmExtraEdges();
 
   TopoDS_Shape aShape;
 
@@ -139,8 +185,13 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
 
         aShape = performOperation (aShapeCopy1, aShapeCopy2, aType);
 
-        if (aShape.IsNull())
+        if (isRmExtraEdges) {
+          aShape = RemoveExtraEdges(aShape);
+        }
+
+        if (aShape.IsNull()) {
           return 0;
+        }
       }
     }
     break;
@@ -208,6 +259,10 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
             aShapeCopy.Nullify();
             TNaming_CopyShape::CopyTool(aShape2, aMapTShapes, aShapeCopy);
            aShape = performOperation (aShape, aShapeCopy, aSimpleType);
+
+            if (isRmExtraEdges) {
+              aShape = RemoveExtraEdges(aShape);
+            }
            
            if (aShape.IsNull()) {
              return 0;
@@ -621,40 +676,50 @@ GetCreationInformation(std::string&             theOperationName,
 
   GEOMImpl_IBoolean aCI (function);
   Standard_Integer aType = function->GetType();
+  Standard_Boolean isCheckSelfInte = aCI.GetCheckSelfIntersection();
 
   switch ( aType ) {
   case BOOLEAN_COMMON:
     theOperationName = "COMMON";
     AddParam( theParams, "Object 1", aCI.GetShape1() );
     AddParam( theParams, "Object 2", aCI.GetShape2() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
     break;
   case BOOLEAN_CUT:
     theOperationName = "CUT";
     AddParam( theParams, "Main Object", aCI.GetShape1() );
     AddParam( theParams, "Tool Object", aCI.GetShape2() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
     break;
   case BOOLEAN_FUSE:
     theOperationName = "FUSE";
     AddParam( theParams, "Object 1", aCI.GetShape1() );
     AddParam( theParams, "Object 2", aCI.GetShape2() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
+    AddParam( theParams, "Remove extra edges", aCI.GetRmExtraEdges() );
     break;
   case BOOLEAN_SECTION:
     theOperationName = "SECTION";
     AddParam( theParams, "Object 1", aCI.GetShape1() );
     AddParam( theParams, "Object 2", aCI.GetShape2() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
     break;
   case BOOLEAN_COMMON_LIST:
     theOperationName = "COMMON";
     AddParam( theParams, "Selected objects", aCI.GetShapes() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
     break;
   case BOOLEAN_FUSE_LIST:
     theOperationName = "FUSE";
     AddParam( theParams, "Selected objects", aCI.GetShapes() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
+    AddParam( theParams, "Remove extra edges", aCI.GetRmExtraEdges() );
     break;
   case BOOLEAN_CUT_LIST:
     theOperationName = "CUT";
     AddParam( theParams, "Main Object", aCI.GetShape1() );
     AddParam( theParams, "Tool Objects", aCI.GetShapes() );
+    AddParam( theParams, "Check self-intersections", isCheckSelfInte );
     break;
   default:
     return false;
index 1985e1afa1b28fa96d4a9e4f3cf0c5723b4e0322..7d9460fcedc3e1fce60735adca605cf514fe61f9 100644 (file)
@@ -29,6 +29,7 @@
 #define BOOL_ARG_SHAPE2                   2
 #define BOOL_ARG_SHAPES                   3
 #define BOOL_ARG_CHECK_SELF_INTERSECTION  4
+#define BOOL_ARG_RM_EXTRA_EDGES           5
 
 class GEOMImpl_IBoolean
 {
@@ -42,6 +43,8 @@ class GEOMImpl_IBoolean
   { _func->SetReferenceList(BOOL_ARG_SHAPES, theShapes); }
   void SetCheckSelfIntersection (Standard_Boolean theFlag)
   { _func->SetInteger(BOOL_ARG_CHECK_SELF_INTERSECTION, theFlag ? 1 : 0); }
+  void SetRmExtraEdges (Standard_Boolean theFlag)
+  { _func->SetInteger(BOOL_ARG_RM_EXTRA_EDGES, theFlag ? 1 : 0); }
 
   Handle(GEOM_Function) GetShape1() { return _func->GetReference(BOOL_ARG_SHAPE1); }
   Handle(GEOM_Function) GetShape2() { return _func->GetReference(BOOL_ARG_SHAPE2); }
@@ -49,6 +52,8 @@ class GEOMImpl_IBoolean
   { return _func->GetReferenceList(BOOL_ARG_SHAPES); }
   Standard_Boolean GetCheckSelfIntersection()
   { return (_func->GetInteger(BOOL_ARG_CHECK_SELF_INTERSECTION) != 0); }
+  Standard_Boolean GetRmExtraEdges()
+  { return (_func->GetInteger(BOOL_ARG_RM_EXTRA_EDGES) != 0); }
 
  private:
 
index a503e4c0931443aa7b0ffe3319c3fa5fff4fe997..644422c4c710d7584a272f43a67c5039fb6008f7 100644 (file)
@@ -148,6 +148,72 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean
   return aBool;
 }
 
+//=============================================================================
+/*!
+ *  MakeFuse
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuse
+                                  (Handle(GEOM_Object)    theShape1,
+                                   Handle(GEOM_Object)    theShape2,
+                                   const bool             IsCheckSelfInte,
+                                   const bool             IsRmExtraEdges)
+{
+  SetErrorCode(KO);
+
+  if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
+
+  //Add a new Boolean object
+  Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+
+  //Add a new Boolean function
+  Handle(GEOM_Function) aFunction =
+    aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_FUSE);
+
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
+
+  GEOMImpl_IBoolean aCI (aFunction);
+
+  Handle(GEOM_Function) aRef1 = theShape1->GetLastFunction();
+  Handle(GEOM_Function) aRef2 = theShape2->GetLastFunction();
+
+  if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
+
+  aCI.SetShape1(aRef1);
+  aCI.SetShape2(aRef2);
+  aCI.SetCheckSelfIntersection(IsCheckSelfInte);
+  aCI.SetRmExtraEdges(IsRmExtraEdges);
+
+  //Compute the Boolean value
+  try {
+#if OCC_VERSION_LARGE > 0x06010000
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Boolean driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump pd (aFunction);
+
+  pd << aBool << " = geompy.MakeFuse(";
+  pd << theShape1 << ", " << theShape2 << ", "
+     << IsCheckSelfInte << ", " << IsRmExtraEdges << ")";
+
+  SetErrorCode(OK);
+  return aBool;
+}
+
 //=============================================================================
 /*!
  *  MakeFuseList
@@ -155,7 +221,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
                   (const Handle(TColStd_HSequenceOfTransient)& theShapes,
-                   const Standard_Boolean IsCheckSelfInte)
+                   const bool                                  IsCheckSelfInte,
+                   const bool                                  IsRmExtraEdges)
 {
   SetErrorCode(KO);
 
@@ -183,6 +250,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
 
   aCI.SetShapes(aShapesSeq);
   aCI.SetCheckSelfIntersection(IsCheckSelfInte);
+  aCI.SetRmExtraEdges(IsRmExtraEdges);
 
   //Compute the Boolean value
   try {
@@ -203,14 +271,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
   //Make a Python command
   GEOM::TPythonDump pd (aFunction);
 
-  pd << aBool <<
-    " = geompy.MakeFuseList([" << aDescription.ToCString() << "]";
-
-  if (IsCheckSelfInte) {
-    pd << ", True";
-  }
-
-  pd << ")";
+  pd << aBool << " = geompy.MakeFuseList([" << aDescription.ToCString() << "], "
+     << IsCheckSelfInte << ", " << IsRmExtraEdges << ")";
 
   SetErrorCode(OK);
   return aBool;
index 8db023a0117f1eccd3f6e20469cded62c15ba202..75c230e2c33c53ade3a2b1361336e39a2c212dac 100644 (file)
@@ -42,9 +42,16 @@ class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
                                  const Standard_Integer theOp,
                                  const Standard_Boolean IsCheckSelfInte);
 
+  Standard_EXPORT Handle(GEOM_Object) MakeFuse
+                                (Handle(GEOM_Object) theShape1,
+                                 Handle(GEOM_Object) theShape2,
+                                 const bool          IsCheckSelfInte,
+                                 const bool          IsRmExtraEdges);
+
   Standard_EXPORT Handle(GEOM_Object) MakeFuseList
                   (const Handle(TColStd_HSequenceOfTransient)& theShapes,
-                   const Standard_Boolean IsCheckSelfInte);
+                   const bool                                  IsCheckSelfInte,
+                   const bool                                  IsRmExtraEdges);
 
   Standard_EXPORT Handle(GEOM_Object) MakeCommonList
                   (const Handle(TColStd_HSequenceOfTransient)& theShapes,
index 66dbcd625e3740235ad3330d52973ba3a2677596..2df45a9f25c7bb1bff68893a2dc85513e9450df6 100644 (file)
@@ -87,6 +87,38 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakeFuse
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuse
+                                    (GEOM::GEOM_Object_ptr theShape1,
+                                     GEOM::GEOM_Object_ptr theShape2,
+                                     CORBA::Boolean        IsCheckSelfInte,
+                                     CORBA::Boolean        IsRmExtraEdges)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference shapes
+  Handle(GEOM_Object) aSh1 = GetObjectImpl(theShape1);
+  Handle(GEOM_Object) aSh2 = GetObjectImpl(theShape2);
+
+  if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn();
+
+  // Make Boolean
+  Handle(GEOM_Object) anObject = GetOperations()->MakeFuse
+    (aSh1, aSh2, IsCheckSelfInte, IsRmExtraEdges);
+
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  MakeFuseList
@@ -94,7 +126,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuseList
                                     (const GEOM::ListOfGO& theShapes,
-                                     CORBA::Boolean        IsCheckSelfInte)
+                                     CORBA::Boolean        IsCheckSelfInte,
+                                     CORBA::Boolean        IsRmExtraEdges)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -110,7 +143,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuseList
 
   // Make fusion
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeFuseList(aShapes, IsCheckSelfInte);
+    GetOperations()->MakeFuseList(aShapes, IsCheckSelfInte, IsRmExtraEdges);
 
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
index dea57d833b5be75ac88a359f221a9661ea0e1cdd..943f6cb9b5d41b456d0854710debd3146750edb9 100644 (file)
@@ -47,8 +47,14 @@ class GEOM_I_EXPORT GEOM_IBooleanOperations_i :
                                     CORBA::Long           theOp,
                                      CORBA::Boolean        IsCheckSelfInte);
 
+  GEOM::GEOM_Object_ptr MakeFuse (GEOM::GEOM_Object_ptr theShape1,
+                                 GEOM::GEOM_Object_ptr theShape2,
+                                  CORBA::Boolean        IsCheckSelfInte,
+                                  CORBA::Boolean        IsRmExtraEdges);
+
   GEOM::GEOM_Object_ptr MakeFuseList (const GEOM::ListOfGO& theShapes,
-                                      CORBA::Boolean        IsCheckSelfInte);
+                                      CORBA::Boolean        IsCheckSelfInte,
+                                      CORBA::Boolean        IsRmExtraEdges);
 
   GEOM::GEOM_Object_ptr MakeCommonList (const GEOM::ListOfGO& theShapes,
                                         CORBA::Boolean        IsCheckSelfInte);
index c269bc7653fe4269ab7ee694b46dc734da0a93fb..057e6b06440d920690b1cd57c9703bb100697d57 100644 (file)
@@ -6846,6 +6846,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape2 Second argument for boolean operation.
         #  @param checkSelfInte The flag that tells if the arguments should
         #         be checked for self-intersection prior to the operation.
+        #  @param rmExtraEdges The flag that tells if Remove Extra Edges
+        #         operation should be performed during the operation.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -6862,7 +6864,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_fuse "Example 1"
         #  \n @ref swig_MakeCommon "Example 2"
-        def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
+        def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
+                     rmExtraEdges=False, theName=None):
             """
             Perform Fuse boolean operation on two given shapes.
 
@@ -6872,6 +6875,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 checkSelfInte The flag that tells if the arguments should
                               be checked for self-intersection prior to
                               the operation.
+                rmExtraEdges The flag that tells if Remove Extra Edges
+                             operation should be performed during the operation.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -6890,8 +6895,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             
             """
             # Example: see GEOM_TestOthers.py
-            # note: auto-publishing is done in self.MakeBoolean()
-            return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
+            anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
+                                         checkSelfInte, rmExtraEdges)
+            RaiseIfFailed("MakeFuse", self.BoolOp)
+            self._autoPublish(anObj, theName, "fuse")
+            return anObj
 
         ## Perform Section boolean operation on two given shapes.
         #  @param theShape1 First argument for boolean operation.
@@ -6949,6 +6957,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShapesList Shapes to be fused.
         #  @param checkSelfInte The flag that tells if the arguments should
         #         be checked for self-intersection prior to the operation.
+        #  @param rmExtraEdges The flag that tells if Remove Extra Edges
+        #         operation should be performed during the operation.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -6965,7 +6975,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_fuse "Example 1"
         #  \n @ref swig_MakeCommon "Example 2"
-        def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
+        def MakeFuseList(self, theShapesList, checkSelfInte=False,
+                         rmExtraEdges=False, theName=None):
             """
             Perform Fuse boolean operation on the list of shapes.
 
@@ -6974,6 +6985,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 checkSelfInte The flag that tells if the arguments should
                               be checked for self-intersection prior to
                               the operation.
+                rmExtraEdges The flag that tells if Remove Extra Edges
+                             operation should be performed during the operation.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -6992,7 +7005,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             
             """
             # Example: see GEOM_TestOthers.py
-            anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
+            anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
+                                             rmExtraEdges)
             RaiseIfFailed("MakeFuseList", self.BoolOp)
             self._autoPublish(anObj, theName, "fuse")
             return anObj
@@ -12662,8 +12676,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 New GEOM_Object, containing the created shape.
             """
-            anObj = self.AdvOp.MakeSmoothingSurface
-                (thelPoints, theNbMax, theDegMax, theDMax)
+            anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
+                                                    theDegMax, theDMax)
             RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
             self._autoPublish(anObj, theName, "smoothing")
             return anObj