From 0650af74abac6c08b6b238eb073e72c9cdc28852 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 28 Jun 2011 11:54:43 +0000 Subject: [PATCH] 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); --- src/SMESH/SMESH_subMesh.cxx | 46 ++++--------------------------------- src/SMESH/SMESH_subMesh.hxx | 6 ----- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index da001a0bf..0b3c98369 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -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 : diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index d5513ffc5..3ec734fe1 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -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 -- 2.30.2