]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/StdMeshers/StdMeshers_Hexa_3D.cxx
Salome HOME
PAL13460 (PAL EDF 301 force the mesh to go through a point)
[modules/smesh.git] / src / StdMeshers / StdMeshers_Hexa_3D.cxx
index c72bae9dd08232ed939f7e64764b8815be0ff889..21490011ba186f324281a6d78e42206cd134bb3f 100644 (file)
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
+//#include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
 
 #include <BRep_Tool.hxx>
 #include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-#include <Handle_Geom2d_Curve.hxx>
-#include <Handle_Geom_Curve.hxx>
+// #include <Geom_Curve.hxx>
+// #include <Geom2d_Curve.hxx>
+// #include <Handle_Geom2d_Curve.hxx>
+// #include <Handle_Geom_Curve.hxx>
 #include <gp_Pnt2d.hxx>
 
 #include "utilities.h"
@@ -115,18 +115,19 @@ bool StdMeshers_Hexa_3D::ClearAndReturn(FaceQuadStruct* theQuads[6], const bool
 //=============================================================================
 
 bool StdMeshers_Hexa_3D::CheckHypothesis
-                         (SMESH_Mesh& aMesh,
-                          const TopoDS_Shape& aShape,
+                         (SMESH_Mesh&                          aMesh,
+                          const TopoDS_Shape&                  aShape,
                           SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
-       //MESSAGE("StdMeshers_Hexa_3D::CheckHypothesis");
-
-       bool isOk = true;
-        aStatus = SMESH_Hypothesis::HYP_OK;
-
-       // nothing to check
-
-       return isOk;
+  // check nb of faces in the shape
+  aStatus = SMESH_Hypothesis::HYP_BAD_GEOMETRY;
+  int nbFaces = 0;
+  for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next())
+    if ( ++nbFaces > 6 )
+      return false;
+
+  aStatus = SMESH_Hypothesis::HYP_OK;
+  return true;
 }
 
 //=======================================================================
@@ -1059,7 +1060,7 @@ bool ComputePentahedralMesh(SMESH_Mesh & aMesh,   const TopoDS_Shape & aShape)
   //
   bOK=anAlgo.Compute(aMesh, aShape);
   //
-  if ( !bOK )
+  if ( !bOK && anAlgo.ErrorStatus() == 5 )
   {
     static StdMeshers_Prism_3D * aPrism3D = 0;
     if ( !aPrism3D ) {