X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_ComputeError.hxx;h=4055741ff4a7c4b11facdaac06b50cf79f2e2824;hp=68a86787040d6bc2325150be924db80a7bd1830b;hb=88141f757b048eaa5aae0be49faaf274448bbcaf;hpb=0ea528b07f13d547b5c860a399af2fc1838059fa diff --git a/src/SMESHUtils/SMESH_ComputeError.hxx b/src/SMESHUtils/SMESH_ComputeError.hxx index 68a867870..4055741ff 100644 --- a/src/SMESHUtils/SMESH_ComputeError.hxx +++ b/src/SMESHUtils/SMESH_ComputeError.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 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 @@ -17,13 +17,15 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : SMESH_Hypothesis.hxx +// File : SMESH_ComputeError.hxx // Author : Edward AGAPOV (eap) // Module : SMESH // #ifndef SMESH_ComputeError_HeaderFile #define SMESH_ComputeError_HeaderFile +#include "SMESH_Utils.hxx" + #include #include #include @@ -63,11 +65,11 @@ enum SMESH_ComputeErrorName // ============================================================= /*! - * \brief Contains an algorithm and description of an occured error + * \brief Contains an algorithm and description of an occurred error */ // ============================================================= -struct SMESH_ComputeError +struct SMESHUtils_EXPORT SMESH_ComputeError { int myName; //!< SMESH_ComputeErrorName or anything algo specific std::string myComment; @@ -89,32 +91,15 @@ struct SMESH_ComputeError 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; -}; + // not inline methods are implemented in src/SMESHUtils/SMESH_TryCatch.cxx -#define _case2char(err) case err: return #err; + // Return myName as text, to be used to dump errors in terminal + std::string CommonName() const; -// 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_NO_MESH_ON_SHAPE); - _case2char(COMPERR_BAD_PARMETERS ); - default:; - } - return ""; -} + // Return the most severe error + static SMESH_ComputeErrorPtr Worst( SMESH_ComputeErrorPtr er1, + SMESH_ComputeErrorPtr er2 ); +}; #endif