]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL9074. Now MakeSolidShells() makes one solid of all given shells like OCC MakeSolid...
authoreap <eap@opencascade.com>
Thu, 30 Jun 2005 08:25:42 +0000 (08:25 +0000)
committereap <eap@opencascade.com>
Thu, 30 Jun 2005 08:25:42 +0000 (08:25 +0000)
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx

index 09e2190a976980b3c8461e521c75fa4a6787031a..dc5d0b9db06420c38a0595c814661ef29a75559c 100644 (file)
@@ -226,8 +226,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     unsigned int ind, nbshapes = aShapes->Length();
     Standard_Integer ish = 0;
     TopoDS_Solid Sol;
-    TopoDS_Compound Res;
-    B.MakeCompound(Res);
+    B.MakeSolid(Sol);
 
     // add shapes
     for (ind = 1; ind <= nbshapes; ind++) {
@@ -237,20 +236,21 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
         Standard_NullObject::Raise("Shell for solid construction is null");
       }
       if (aShapeShell.ShapeType() == TopAbs_SHELL) {
-        B.MakeSolid(Sol);
         B.Add(Sol, aShapeShell);
-        BRepClass3d_SolidClassifier SC (Sol);
-        SC.PerformInfinitePoint(Precision::Confusion());
-        if (SC.State() == TopAbs_IN) {
-          B.MakeSolid(Sol);
-          B.Add(Sol, aShapeShell.Reversed());
-        }
-        B.Add(Res, Sol);
         ish++;
       }
     }
-    if (ish == 1) aShape = Sol;
-    else          aShape = Res;
+    if ( ish == 0 ) return 0;
+    BRepClass3d_SolidClassifier SC (Sol);
+    SC.PerformInfinitePoint(Precision::Confusion());
+    switch (SC.State()) {
+    case TopAbs_IN:
+      aShape = Sol.Reversed(); break;
+    case TopAbs_OUT:
+      aShape = Sol; break;
+    default: // not closed shell?
+      return 0;
+    }
 
   } else if (aType == COMPOUND_SHAPES) {
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();