Salome HOME
Do not glue empty compounds
authorjfa <jfa@opencascade.com>
Mon, 16 Jul 2007 07:16:26 +0000 (07:16 +0000)
committerjfa <jfa@opencascade.com>
Mon, 16 Jul 2007 07:16:26 +0000 (07:16 +0000)
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx

index dc0ac24cf060ab24dbc7b20ec9c30852e4e17148..c419cd6d5f93adbc78297384662cad6e3a0c762f 100644 (file)
@@ -169,7 +169,11 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
         */
 
         // As GlueFaces has been improved to keep all kind of shapes
-        aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        TopExp_Explorer anExp (C, TopAbs_VERTEX);
+        if (anExp.More())
+          aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        else
+          aShape = C;
       }
     }
 
@@ -236,7 +240,11 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
         */
 
         // As GlueFaces has been improved to keep all kind of shapes
-        aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        TopExp_Explorer anExp (C, TopAbs_VERTEX);
+        if (anExp.More())
+          aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        else
+          aShape = C;
       }
     }
 
@@ -383,7 +391,11 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const
         //aShape = C;
 
         // As GlueFaces has been improved to keep all kind of shapes
-        aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        TopExp_Explorer anExp (C, TopAbs_VERTEX);
+        if (anExp.More())
+          aShape = GEOMImpl_GlueDriver::GlueFaces(C, Precision::Confusion(), Standard_True);
+        else
+          aShape = C;
       }
     }