X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=86da9d3a0dfbf5c6a8be79f26242592b881a2587;hp=3af8072816c5befef88feff24429a594018483dc;hb=9e9e56ba2677f1b35f0ab2877b9ef95b29dcf34d;hpb=608c27e671aa5cb43d7a19eafbdb00399cedf1d6 diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 3af807281..86da9d3a0 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -53,7 +53,7 @@ #include #include -#include +#include #include using namespace std; @@ -1400,6 +1400,20 @@ bool SMESH_subMesh::ComputeStateEngine(int event) if ( !ret ) _computeError = algo->GetComputeError(); } + catch ( std::bad_alloc& exc ) { + if ( _computeError ) { + _computeError->myName = COMPERR_MEMORY_PB; + //_computeError->myComment = exc.what(); + } + throw exc; + } + catch ( Standard_OutOfMemory& exc ) { + if ( _computeError ) { + _computeError->myName = COMPERR_MEMORY_PB; + //_computeError->myComment = exc.what(); + } + throw exc; + } catch (Standard_Failure& exc) { if ( !_computeError ) _computeError = SMESH_ComputeError::New(); _computeError->myName = COMPERR_OCC_EXCEPTION; @@ -1410,13 +1424,6 @@ bool SMESH_subMesh::ComputeStateEngine(int event) _computeError->myName = COMPERR_SLM_EXCEPTION; _computeError->myComment = S_ex.what(); } - catch ( std::bad_alloc& exc ) { - if ( _computeError ) { - _computeError->myName = COMPERR_MEMORY_PB; - _computeError->myComment = exc.what(); - } - throw exc; - } catch ( std::exception& exc ) { if ( !_computeError ) _computeError = SMESH_ComputeError::New(); _computeError->myName = COMPERR_STD_EXCEPTION; @@ -1604,7 +1611,7 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo) // Show error SMESH_Comment text; - text << theAlgo->GetName() << " failed on subshape " << _Id << " with error "; + text << theAlgo->GetName() << " failed on subshape #" << _Id << " with error "; if (_computeError->IsCommon() ) text << _computeError->CommonName(); else @@ -1615,11 +1622,12 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo) #ifdef _DEBUG_ cout << text << endl; // Show vertices location of a failed shape - cout << "Subshape vertices (first 10):" << endl; TopTools_IndexedMapOfShape vMap; TopExp::MapShapes( _subShape, TopAbs_VERTEX, vMap ); + cout << "Subshape vertices " << ( vMap.Extent()>10 ? "(first 10):" : ":") << endl; for ( int iv = 1; iv <= vMap.Extent() && iv < 11; ++iv ) { gp_Pnt P( BRep_Tool::Pnt( TopoDS::Vertex( vMap( iv ) ))); + cout << "#" << _father->GetMeshDS()->ShapeToIndex( vMap( iv )) << " "; cout << P.X() << " " << P.Y() << " " << P.Z() << " " << endl; } #else