IPAL22173 TC6.2.0: "Netgen1D-2D" algorithm doesn't work on "flight_solid.brep"

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);
This commit is contained in:
eap 2011-06-28 11:54:43 +00:00
parent 3eefc085d8
commit 0650af74ab
2 changed files with 4 additions and 48 deletions

View File

@ -1456,7 +1456,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
} }
} }
} }
if (ret) if (ret && _computeError && _computeError->myName != COMPERR_WARNING )
{ {
_computeError.reset(); _computeError.reset();
} }
@ -1720,6 +1720,7 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& t
// Check my state // Check my state
if ( !_computeError || _computeError->IsOK() ) 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; _computeState = IsMeshComputed() ? COMPUTE_OK : FAILED_TO_COMPUTE;
} }
else else
@ -1739,53 +1740,14 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& t
INFOS( text ); INFOS( text );
_computeState = FAILED_TO_COMPUTE; _computeState = _computeError->IsKO() ? FAILED_TO_COMPUTE : COMPUTE_OK;
noErrors = false; noErrors = false;
} }
} }
return noErrors; 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 //function : UpdateSubMeshState
//purpose : //purpose :

View File

@ -266,12 +266,6 @@ protected:
SMESH_Algo* theAlgo, SMESH_Algo* theAlgo,
bool & theSubComputed); 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 * \brief Update compute_state by _computeError
* \retval bool - false if there are errors * \retval bool - false if there are errors