Salome HOME
Fix for NPAL17873.
[modules/smesh.git] / src / StdMeshers / StdMeshers_RadialPrism_3D.cxx
index eab107c7688dc96b1e0e9cc2400d88e66eee8101..0d9d2daff864ab59e732c2486f6c3f9ee9cee566 100644 (file)
 
 #include "utilities.h"
 
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Shell.hxx>
-#include <BRepTools.hxx>
 #include <BRepAdaptor_Curve.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepTools.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Solid.hxx>
 #include <gp.hxx>
 #include <gp_Pnt.hxx>
 
 
 using namespace std;
 
-#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
+#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
 #define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
 
 typedef StdMeshers_ProjectionUtils TAssocTool;
@@ -98,13 +99,14 @@ bool StdMeshers_RadialPrism_3D::CheckHypothesis(SMESH_Mesh&
                                                 SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
   // check aShape that must have 2 shells
+/*  PAL16229
   if ( TAssocTool::Count( aShape, TopAbs_SOLID, 0 ) != 1 ||
        TAssocTool::Count( aShape, TopAbs_SHELL, 0 ) != 2 )
   {
     aStatus = HYP_BAD_GEOMETRY;
     return false;
   }
-
+*/
   myNbLayerHypo = 0;
   myDistributionHypo = 0;
 
@@ -167,7 +169,7 @@ bool StdMeshers_RadialPrism_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& a
     if ( !outerShell.IsSame( It.Value() ))
       innerShell = It.Value();
   if ( nbShells != 2 )
-    return error(COMPERR_BAD_SHAPE, SMESH_Comment("Must be 2 shells but not")<<nbShells);
+    return error(COMPERR_BAD_SHAPE, SMESH_Comment("Must be 2 shells but not ")<<nbShells);
 
   // ----------------------------------
   // Associate subshapes of the shells
@@ -328,13 +330,13 @@ public:
     TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut );
     SMESH_Hypothesis::Hypothesis_Status aStatus;
     if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus ))
-      return error( "StdMeshers_Regular_1D::CheckHypothesis() failed"
-                   "with LayerDistribution hypothesis");
+      return error( "StdMeshers_Regular_1D::CheckHypothesis() failed "
+                    "with LayerDistribution hypothesis");
 
     BRepAdaptor_Curve C3D(edge);
     double f = C3D.FirstParameter(), l = C3D.LastParameter();
     list< double > params;
-    if ( !StdMeshers_Regular_1D::computeInternalParameters( C3D, len, f, l, params, false ))
+    if ( !StdMeshers_Regular_1D::computeInternalParameters( aMesh, C3D, len, f, l, params, false ))
       return error("StdMeshers_Regular_1D failed to compute layers distribution");
 
     positions.clear();