]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Changed for 0019296 (Evaluation).
authorskl <skl@opencascade.com>
Wed, 16 Sep 2009 06:13:07 +0000 (06:13 +0000)
committerskl <skl@opencascade.com>
Wed, 16 Sep 2009 06:13:07 +0000 (06:13 +0000)
src/StdMeshers/StdMeshers_MEFISTO_2D.cxx

index 6a84ee7b835d99db020ddce13c39554d170fc55d..ca1ef9e11f6bae347de3ed8a7b4339c47a7dee02 100644 (file)
@@ -332,10 +332,17 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh,
       P1 = P2;
     }
   }
-  if ( NbSeg > 0 )
-    aLen = aLen/NbSeg; // middle length
-  else
-    aLen = Precision::Infinite();
+  if(NbSeg<1) {
+    std::vector<int> aResVec(SMDSEntity_Last);
+    for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
+    SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
+    aResMap.insert(std::make_pair(sm,aResVec));
+    SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
+    smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
+                                          "Submesh can not be evaluated",this));
+    return false;
+  }
+  aLen = aLen/NbSeg; // middle length
 
   _edgeLength = Precision::Infinite();
   double tmpLength = Min( _edgeLength, aLen );