]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL13330( When mesh generation does not success, trace where )
authoreap <eap@opencascade.com>
Thu, 12 Apr 2007 08:59:13 +0000 (08:59 +0000)
committereap <eap@opencascade.com>
Thu, 12 Apr 2007 08:59:13 +0000 (08:59 +0000)
   care of states of descendants of submesh where !algo->NeedDescretBoundary()

src/SMESH/SMESH_subMesh.cxx

index f8dbe11d48e8a012061b5aaa8543fce99c998d6a..78bc9ce7a0935aca40937667fa69fe0eaf4546a9 100644 (file)
@@ -1419,6 +1419,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
         catch ( ... ) {
           if ( _computeError )
             _computeError->myName = COMPERR_EXCEPTION;
+          else
+            ret = false;
         }
         if ( ret && _computeError && !_computeError->IsOK() ) {
           ret = false;
@@ -1439,6 +1441,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
           _computeError.reset();
           UpdateDependantsState( SUBMESH_COMPUTED ); // send event SUBMESH_COMPUTED
         }
+        if ( !algo->NeedDescretBoundary() )
+          UpdateSubMeshState( ret ? COMPUTE_OK : FAILED_TO_COMPUTE );
         CheckComputeError( algo );
       }
       break;
@@ -1648,24 +1652,24 @@ bool SMESH_subMesh::ApplyToCollection (SMESH_Algo*         theAlgo,
   bool ok = theAlgo->Compute( *_father, theCollection );
 
   // set _computeState of subshapes
-  bool localOK = true;
   TopExp_Explorer anExplorer( theCollection, _subShape.ShapeType() );
   for ( ; anExplorer.More(); anExplorer.Next() )
   {
     if ( SMESH_subMesh* subMesh = _father->GetSubMeshContaining( anExplorer.Current() ))
     {
-      if ( !subMesh->CheckComputeError( theAlgo ))
-        localOK = false;
-      else
+      bool localOK = subMesh->CheckComputeError( theAlgo );
+      if ( !ok && localOK && !subMesh->IsMeshComputed() )
+      {
+        subMesh->_computeError = theAlgo->GetComputeError();
+        if ( subMesh->_computeError->IsOK() )
+          _computeError = SMESH_ComputeError::New(COMPERR_ALGO_FAILED);
+        localOK = CheckComputeError( theAlgo );
+      }
+      if ( localOK )
         subMesh->UpdateDependantsState( SUBMESH_COMPUTED );
+      subMesh->UpdateSubMeshState( localOK ? COMPUTE_OK : FAILED_TO_COMPUTE );
     }
   }
-  if ( !ok && localOK ) { // KO but error set to none submesh
-    _computeError = theAlgo->GetComputeError();
-    if ( _computeError->IsOK() )
-      _computeError = SMESH_ComputeError::New(COMPERR_ALGO_FAILED);
-    CheckComputeError( theAlgo );
-  }
 
   return true;
 }