Salome HOME
PAL9022. bind generated mesh elements to the outer shell T2_2_4a3 V2_2_4 V2_2_4b1
authoreap <eap@opencascade.com>
Thu, 9 Jun 2005 06:18:26 +0000 (06:18 +0000)
committereap <eap@opencascade.com>
Thu, 9 Jun 2005 06:18:26 +0000 (06:18 +0000)
src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx

index db0c493cba8683fa8fdf896403fb1c4e7bc25991..5c530643c07da628913f57b14c2309cd30148942 100644 (file)
@@ -19,6 +19,7 @@ using namespace std;
 #include "SMDS_MeshNode.hxx"
 
 #include <TopExp.hxx>
+#include <BRepTools.hxx>
 
 #include "utilities.h"
 
@@ -127,9 +128,14 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh&         aMesh,
 
   // get a shell from aShape
   TopoDS_Shell aShell;
-  TopExp_Explorer exp(aShape,TopAbs_SHELL);
-  if ( exp.More() )
-    aShell = TopoDS::Shell(exp.Current());
+  if ( aShape.ShapeType() == TopAbs_SOLID ) {
+    aShell = BRepTools::OuterShell( TopoDS::Solid( aShape ));
+  }
+  else {
+    TopExp_Explorer exp(aShape,TopAbs_SHELL);
+    if ( exp.More() )
+      aShell = TopoDS::Shell(exp.Current());
+  }
 
   if ( aShell.IsNull() || !aMesh.GetSubMesh( aShell )) {
     INFOS( "NETGENPlugin_NETGEN_3D::Compute(), bad shape");