Fix reporting a warning if no elements are assigned to a sub-shape
+ // 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());
TopExp_Explorer subS(shape, _subShape.ShapeType());
- if (ret) // check if anything was built
{
for (; ret && subS.More(); subS.Next())
ret = _father->GetSubMesh( subS.Current() )->IsMeshComputed();
}
{
for (; ret && subS.More(); subS.Next())
ret = _father->GetSubMesh( subS.Current() )->IsMeshComputed();
}
- bool isComputeErrorSet = !checkComputeError( algo, shape );
if (!ret && !isComputeErrorSet)
{
if (!ret && !isComputeErrorSet)
{
for (subS.ReInit(); subS.More(); subS.Next())
{
SMESH_subMesh* sm = _father->GetSubMesh( subS.Current() );
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)
{
SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false);
while ( smIt->more() )
{
SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false);
while ( smIt->more() )
- if ( !smIt->next()->checkComputeError( theAlgo ))
+ if ( !smIt->next()->checkComputeError( theAlgo, theComputeOK ))
for (TopoDS_Iterator subIt( theShape ); subIt.More(); subIt.Next()) {
SMESH_subMesh* sm = _father->GetSubMesh( subIt.Value() );
if ( sm != this ) {
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
}
noErrors = false;
updateDependantsState( SUBMESH_COMPUTED ); // send event SUBMESH_COMPUTED
}
- _computeState = FAILED_TO_COMPUTE;
if ( !_computeError || _computeError->IsOK() )
{
// no error description is set to this sub-mesh, check if any mesh is computed
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;
if ( _subShape.ShapeType() == TopAbs_EDGE &&
BRep_Tool::Degenerated( TopoDS::Edge( _subShape )) )
_computeState = COMPUTE_OK;
+ else if ( theComputeOK )
_computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);
}
_computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);
}
- noErrors = ( _computeState == COMPUTE_OK );
+
+ if ( _computeError && !_computeError->IsOK() )
{
if ( !_computeError->myAlgo )
_computeError->myAlgo = theAlgo;
{
if ( !_computeError->myAlgo )
_computeError->myAlgo = theAlgo;
_computeState = _computeError->IsKO() ? FAILED_TO_COMPUTE : COMPUTE_OK;
_computeState = _computeError->IsKO() ? FAILED_TO_COMPUTE : COMPUTE_OK;