else
ret = false;
}
+ // check if an error reported on any sub-shape
+ bool isComputeErrorSet = !checkComputeError( algo, ret, shape );
+ // check if anything was built
TopExp_Explorer subS(shape, _subShape.ShapeType());
- if (ret) // check if anything was built
+ if (ret)
{
for (; ret && subS.More(); subS.Next())
ret = _father->GetSubMesh( subS.Current() )->IsMeshComputed();
}
- bool isComputeErrorSet = !checkComputeError( algo, shape );
+ // Set _computeError
if (!ret && !isComputeErrorSet)
{
- // Set _computeError
for (subS.ReInit(); subS.More(); subS.Next())
{
SMESH_subMesh* sm = _father->GetSubMesh( subS.Current() );
*/
//=======================================================================
-bool SMESH_subMesh::checkComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& theShape)
+bool SMESH_subMesh::checkComputeError(SMESH_Algo* theAlgo,
+ const bool theComputeOK,
+ const TopoDS_Shape& theShape)
{
bool noErrors = true;
{
SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false);
while ( smIt->more() )
- if ( !smIt->next()->checkComputeError( theAlgo ))
+ if ( !smIt->next()->checkComputeError( theAlgo, theComputeOK ))
noErrors = false;
}
for (TopoDS_Iterator subIt( theShape ); subIt.More(); subIt.Next()) {
SMESH_subMesh* sm = _father->GetSubMesh( subIt.Value() );
if ( sm != this ) {
- if ( !sm->checkComputeError( theAlgo, sm->GetSubShape() ))
+ if ( !sm->checkComputeError( theAlgo, theComputeOK, sm->GetSubShape() ))
noErrors = false;
updateDependantsState( SUBMESH_COMPUTED ); // send event SUBMESH_COMPUTED
}
// Set my _computeState
- _computeState = FAILED_TO_COMPUTE;
if ( !_computeError || _computeError->IsOK() )
{
// no error description is set to this sub-mesh, check if any mesh is computed
if ( _subShape.ShapeType() == TopAbs_EDGE &&
BRep_Tool::Degenerated( TopoDS::Edge( _subShape )) )
_computeState = COMPUTE_OK;
- else
+ else if ( theComputeOK )
_computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);
}
- noErrors = ( _computeState == COMPUTE_OK );
}
- if ( !noErrors )
+
+ if ( _computeError && !_computeError->IsOK() )
{
if ( !_computeError->myAlgo )
_computeError->myAlgo = theAlgo;
_computeState = _computeError->IsKO() ? FAILED_TO_COMPUTE : COMPUTE_OK;
+ noErrors = false;
}
}
return noErrors;