]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
prevent SIGFPE with "Scale distribution" and "nb segments = 1"
authoreap <eap@opencascade.com>
Thu, 13 Apr 2006 07:17:06 +0000 (07:17 +0000)
committereap <eap@opencascade.com>
Thu, 13 Apr 2006 07:17:06 +0000 (07:17 +0000)
src/StdMeshers/StdMeshers_Regular_1D.cxx

index 5390c0428bbe8c0dee4b99b7783754b7ea30d463..28ddd2bddcdd58a6f390c8d4126ff2b59112be48 100644 (file)
@@ -368,11 +368,14 @@ bool StdMeshers_Regular_1D::computeInternalParameters(const TopoDS_Edge& theEdge
     else
     {
       // Number Of Segments hypothesis
+      int NbSegm = _ivalue[ NB_SEGMENTS_IND ];
+      if ( NbSegm < 1 )  return false;
+      if ( NbSegm == 1 ) return true;
+
       switch (_ivalue[ DISTR_TYPE_IND ])
       {
       case StdMeshers_NumberOfSegments::DT_Scale:
         {
-          int NbSegm   = _ivalue[ NB_SEGMENTS_IND ];
           double scale = _value[ SCALE_FACTOR_IND ];
 
           if (fabs(scale - 1.0) < Precision::Confusion()) {