X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_ComputeError.hxx;h=57e4214ff0ab5c3d6b73eacf350c91d19cc6ad76;hp=8e90db5823b6d8e715235a703f7b668884dfc1bd;hb=0fc0831670e27a5611b941c52dc152fd63964515;hpb=6bac08c1a81f34d3f21c550bd92f83654b2546a5 diff --git a/src/SMESHUtils/SMESH_ComputeError.hxx b/src/SMESHUtils/SMESH_ComputeError.hxx index 8e90db582..57e4214ff 100644 --- a/src/SMESHUtils/SMESH_ComputeError.hxx +++ b/src/SMESHUtils/SMESH_ComputeError.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -25,6 +25,7 @@ #define SMESH_ComputeError_HeaderFile #include "SMESH_Utils.hxx" +#include "SMDS_ElementHolder.hxx" #include #include @@ -65,7 +66,7 @@ enum SMESH_ComputeErrorName // ============================================================= /*! - * \brief Contains an algorithm and description of an occured error + * \brief Contains an algorithm and description of an occurred error */ // ============================================================= @@ -75,22 +76,20 @@ struct SMESHUtils_EXPORT SMESH_ComputeError std::string myComment; const SMESH_Algo* myAlgo; - std::list myBadElements; //!< to explain COMPERR_BAD_INPUT_MESH - static SMESH_ComputeErrorPtr New( int error = COMPERR_OK, std::string comment = "", const SMESH_Algo* algo = 0) { return SMESH_ComputeErrorPtr( new SMESH_ComputeError( error, comment, algo )); } - SMESH_ComputeError(int error = COMPERR_OK, - std::string comment = "", - const SMESH_Algo* algo = 0) - :myName(error),myComment(comment),myAlgo(algo) {} + SMESH_ComputeError( int error = COMPERR_OK, + std::string comment = "", + const SMESH_Algo* algo = 0) + : myName(error), myComment(comment), myAlgo(algo) {} 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(); } + virtual bool HasBadElems() const { return false; } // not inline methods are implemented in src/SMESHUtils/SMESH_TryCatch.cxx @@ -100,6 +99,31 @@ struct SMESHUtils_EXPORT SMESH_ComputeError // Return the most severe error static SMESH_ComputeErrorPtr Worst( SMESH_ComputeErrorPtr er1, SMESH_ComputeErrorPtr er2 ); + + virtual ~SMESH_ComputeError() {} +}; + +struct SMESHUtils_EXPORT SMESH_BadInputElements : public SMESH_ComputeError, SMDS_ElementHolder +{ + typedef std::list TElemList; + TElemList myBadElements; //!< to explain COMPERR_BAD_INPUT_MESH + + SMESH_BadInputElements(const SMDS_Mesh* mesh, + int error = COMPERR_OK, + std::string comment = "", + const SMESH_Algo* algo = 0) + :SMESH_ComputeError(error, comment ,algo), SMDS_ElementHolder(mesh) {} + + const SMDS_Mesh* GetMesh() const { return myMesh; } + const TElemList& GetElements() { return myBadElements; } + + virtual bool HasBadElems() const { return !myBadElements.empty(); } + + // methods of SMDS_ElementHolder + virtual SMDS_ElemIteratorPtr getElements(); + virtual void tmpClear(); + virtual void add( const SMDS_MeshElement* element ); + virtual void compact() { } }; #endif