]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
IPAL22173 TC6.2.0: "Netgen1D-2D" algorithm doesn't work on "flight_solid.brep"
authoreap <eap@opencascade.com>
Tue, 28 Jun 2011 11:54:43 +0000 (11:54 +0000)
committereap <eap@opencascade.com>
Tue, 28 Jun 2011 11:54:43 +0000 (11:54 +0000)
    1) Treate a case where a valid mesh is computed anyhow while the algo reports errors
    2) Remove unused
-  bool ApplyToCollection (SMESH_Algo*         theAlgo,
-                          const TopoDS_Shape& theCollection);

src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx

index da001a0bfcdd554ea8129de21fec3be5a0dacbea..0b3c98369862f4a68e52e582d36aa1c017d2ff24 100644 (file)
@@ -1456,7 +1456,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
             }
           }
         }
-        if (ret)
+        if (ret && _computeError && _computeError->myName != COMPERR_WARNING )
         {
           _computeError.reset();
         }
@@ -1720,6 +1720,7 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& t
     // Check my state
     if ( !_computeError || _computeError->IsOK() )
     {
+      // no error description is set to this sub-mesh, check if any mesh is computed
       _computeState = IsMeshComputed() ? COMPUTE_OK : FAILED_TO_COMPUTE;
     }
     else
@@ -1739,53 +1740,14 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& t
 
       INFOS( text );
 
-      _computeState = FAILED_TO_COMPUTE;
+      _computeState = _computeError->IsKO() ? FAILED_TO_COMPUTE : COMPUTE_OK;
+
       noErrors = false;
     }
   }
   return noErrors;
 }
 
-//=======================================================================
-//function : ApplyToCollection
-//purpose  : Apply theAlgo to all subshapes in theCollection
-//=======================================================================
-
-bool SMESH_subMesh::ApplyToCollection (SMESH_Algo*         theAlgo,
-                                       const TopoDS_Shape& theCollection)
-{
-  MESSAGE("SMESH_subMesh::ApplyToCollection");
-  ASSERT ( !theAlgo->NeedDescretBoundary() );
-
-  if ( _computeError )
-    _computeError->myName = COMPERR_OK;
-
-  bool ok = theAlgo->Compute( *_father, theCollection );
-
-  // set _computeState of subshapes
-  TopExp_Explorer anExplorer( theCollection, _subShape.ShapeType() );
-  for ( ; anExplorer.More(); anExplorer.Next() )
-  {
-    if ( SMESH_subMesh* subMesh = _father->GetSubMeshContaining( anExplorer.Current() ))
-    {
-      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 );
-    }
-  }
-
-  return true;
-}
-
-
 //=======================================================================
 //function : UpdateSubMeshState
 //purpose  :
index d5513ffc5e45204caca9382b86993af88c09d38a..3ec734fe19c61915c09aaa5706ec05c31b66384f 100644 (file)
@@ -266,12 +266,6 @@ protected:
                              SMESH_Algo* theAlgo,
                              bool &      theSubComputed);
 
-  /*!
-   * \brief Apply theAlgo to all subshapes in theCollection
-   */
-  bool ApplyToCollection (SMESH_Algo*         theAlgo,
-                          const TopoDS_Shape& theCollection);
-
   /*!
    * \brief Update compute_state by _computeError
     * \retval bool - false if there are errors