X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_ComputeError.hxx;h=07d1a90889898df6f7d817cffc374db5de75736c;hb=86aa8ad014c9dffcded9d98528feec1e8bf6dcc6;hp=204427f088dc5275ac9f13d267caf7bc7a6348fb;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_ComputeError.hxx b/src/SMESHUtils/SMESH_ComputeError.hxx index 204427f08..07d1a9088 100644 --- a/src/SMESHUtils/SMESH_ComputeError.hxx +++ b/src/SMESHUtils/SMESH_ComputeError.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -40,17 +40,25 @@ enum SMESH_ComputeErrorName { // If you modify it, pls update SMESH_ComputeError::CommonName() below. // Positive values are for algo specific errors - COMPERR_OK = -1, - COMPERR_BAD_INPUT_MESH = -2, //!< wrong mesh on lower submesh - COMPERR_STD_EXCEPTION = -3, //!< some std exception raised - COMPERR_OCC_EXCEPTION = -4, //!< OCC exception raised - COMPERR_SLM_EXCEPTION = -5, //!< SALOME exception raised - COMPERR_EXCEPTION = -6, //!< other exception raised - COMPERR_MEMORY_PB = -7, //!< std::bad_alloc exception - COMPERR_ALGO_FAILED = -8, //!< algo failed for some reason - COMPERR_BAD_SHAPE = -9, //!< bad geometry - COMPERR_WARNING = -10, //!< algo reports error but sub-mesh is computed anyway - COMPERR_CANCELED = -11 //!< compute canceled + COMPERR_OK = -1, + COMPERR_BAD_INPUT_MESH = -2, //!< wrong mesh on lower submesh + COMPERR_STD_EXCEPTION = -3, //!< some std exception raised + COMPERR_OCC_EXCEPTION = -4, //!< OCC exception raised + COMPERR_SLM_EXCEPTION = -5, //!< SALOME exception raised + COMPERR_EXCEPTION = -6, //!< other exception raised + COMPERR_MEMORY_PB = -7, //!< std::bad_alloc exception + COMPERR_ALGO_FAILED = -8, //!< algo failed for some reason + COMPERR_BAD_SHAPE = -9, //!< bad geometry + COMPERR_WARNING = -10, //!< algo reports error but sub-mesh is computed anyway + COMPERR_CANCELED = -11, //!< compute canceled + COMPERR_NO_MESH_ON_SHAPE = -12, //!< no mesh elements assigned to sub-shape + COMPERR_BAD_PARMETERS = -13, //!< incorrect hypotheses parameters + COMPERR_LAST_ALGO_ERROR = -100,//!< terminator of mesh computation errors + // Errors of SMESH_MeshEditor follow + EDITERR_NO_MEDIUM_ON_GEOM= -101 /* during conversion to quadratic, + some medium nodes not placed on geometry + to avoid distorting elements, which are + stored in SMESH_ComputeError::myBadElements */ }; // ============================================================= @@ -77,29 +85,32 @@ struct SMESH_ComputeError const SMESH_Algo* algo = 0) :myName(error),myComment(comment),myAlgo(algo) {} - bool IsOK() { return myName == COMPERR_OK; } - bool IsKO() { return myName != COMPERR_OK && myName != COMPERR_WARNING; } - bool IsCommon() { return myName < 0; } + bool IsOK() const { return myName == COMPERR_OK; } + bool IsKO() const { return myName != COMPERR_OK && myName != COMPERR_WARNING; } + bool IsCommon() const { return myName < 0 && myName > COMPERR_LAST_ALGO_ERROR; } + bool HasBadElems() const { return !myBadElements.empty(); } inline std::string CommonName() const; }; #define _case2char(err) case err: return #err; +// Return myName as text, to be used to dump errors in terminal std::string SMESH_ComputeError::CommonName() const { switch( myName ) { - _case2char(COMPERR_OK ); - _case2char(COMPERR_BAD_INPUT_MESH); - _case2char(COMPERR_STD_EXCEPTION ); - _case2char(COMPERR_OCC_EXCEPTION ); - _case2char(COMPERR_SLM_EXCEPTION ); - _case2char(COMPERR_EXCEPTION ); - _case2char(COMPERR_MEMORY_PB ); - _case2char(COMPERR_ALGO_FAILED ); - _case2char(COMPERR_BAD_SHAPE ); - _case2char(COMPERR_WARNING ); - _case2char(COMPERR_CANCELED ); + _case2char(COMPERR_OK ); + _case2char(COMPERR_BAD_INPUT_MESH ); + _case2char(COMPERR_STD_EXCEPTION ); + _case2char(COMPERR_OCC_EXCEPTION ); + _case2char(COMPERR_SLM_EXCEPTION ); + _case2char(COMPERR_EXCEPTION ); + _case2char(COMPERR_MEMORY_PB ); + _case2char(COMPERR_ALGO_FAILED ); + _case2char(COMPERR_BAD_SHAPE ); + _case2char(COMPERR_WARNING ); + _case2char(COMPERR_CANCELED ); + _case2char(COMPERR_NO_MESH_ON_SHAPE); default:; } return "";