SALOME - SMESH
SMESH_ComputeError.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // SMESH SMESH : implementaion of SMESH idl descriptions
23 // File : SMESH_Hypothesis.hxx
24 // Author : Edward AGAPOV (eap)
25 // Module : SMESH
26 // $Header:
27 //
28 #ifndef SMESH_ComputeError_HeaderFile
29 #define SMESH_ComputeError_HeaderFile
30 
31 #include <string>
32 #include <list>
33 #include <boost/shared_ptr.hpp>
34 
35 class SMESH_Algo;
36 class SMDS_MeshElement;
38 
39 typedef boost::shared_ptr<SMESH_ComputeError> SMESH_ComputeErrorPtr;
40 
41 // =============================================================
42 
44 {
45  // If you modify it, pls update SMESH_ComputeError::CommonName() below.
46  // Positive values are for algo specific errors
47  COMPERR_OK = -1,
56 };
57 
58 // =============================================================
62 // =============================================================
63 
65 {
66  int myName;
67  std::string myComment;
69 
70  std::list<const SMDS_MeshElement*> myBadElements;
71 
72  static SMESH_ComputeErrorPtr New( int error = COMPERR_OK,
73  std::string comment = "",
74  const SMESH_Algo* algo = 0)
75  { return SMESH_ComputeErrorPtr( new SMESH_ComputeError( error, comment, algo )); }
76 
78  std::string comment = "",
79  const SMESH_Algo* algo = 0)
80  :myName(error),myComment(comment),myAlgo(algo) {}
81 
82  bool IsOK() { return myName == COMPERR_OK; }
83  bool IsCommon() { return myName < 0; }
84  inline std::string CommonName() const;
85 
86 };
87 
88 #define _case2char(err) case err: return #err;
89 
90 std::string SMESH_ComputeError::CommonName() const
91 {
92  switch( myName ) {
101  default:;
102  }
103  return "";
104 }
105 
106 #endif
OCC exception raised.
std::list< const SMDS_MeshElement * > myBadElements
to explain COMPERR_BAD_INPUT_MESH
some std exception raised
#define _case2char(err)
int myName
SMESH_ComputeErrorName or anything algo specific.
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
other exception raised
SALOME exception raised.
SMESH_ComputeError(int error=COMPERR_OK, std::string comment="", const SMESH_Algo *algo=0)
std::bad_alloc exception
std::string CommonName() const
Base class for elements.
Contains algorithm and description of occured error.
static SMESH_ComputeErrorPtr New(int error=COMPERR_OK, std::string comment="", const SMESH_Algo *algo=0)
SMESH_ComputeErrorName
algo failed for some reason
const SMESH_Algo * myAlgo
wrong mesh on lower submesh