#include <TopoDS_Compound.hxx>
#include <gp_Pnt.hxx>
-#include <Standard_Failure.hxx>
+#include <Standard_OutOfMemory.hxx>
#include <Standard_ErrorHandler.hxx>
using namespace std;
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;
_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;
// 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
#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