Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/smesh.git] / src / SMESH / SMESH_ComputeError.hxx
index 91f2712c2f3990aca4e44895f77c5908d6c8943c..a764f0a3b34e43eb9815539ba6ffaece663d88af 100644 (file)
@@ -1,38 +1,39 @@
-//  SMESH SMESH : implementaion of SMESH idl descriptions
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SMESH SMESH : implementaion of SMESH idl descriptions
 //  File   : SMESH_Hypothesis.hxx
 //  Author : Edward AGAPOV (eap)
 //  Module : SMESH
 //  $Header: 
-
+//
 #ifndef SMESH_ComputeError_HeaderFile
 #define SMESH_ComputeError_HeaderFile
 
 #include <string>
+#include <list>
 #include <boost/shared_ptr.hpp>
 
 class SMESH_Algo;
+class SMDS_MeshElement;
 struct SMESH_ComputeError;
 
 typedef boost::shared_ptr<SMESH_ComputeError> SMESH_ComputeErrorPtr;
@@ -66,6 +67,8 @@ struct SMESH_ComputeError
   std::string       myComment;
   const SMESH_Algo* myAlgo;
 
+  std::list<const SMDS_MeshElement*> myBadElements; //!< to explain COMPERR_BAD_INPUT_MESH
+
   static SMESH_ComputeErrorPtr New( int               error   = COMPERR_OK,
                                     std::string       comment = "",
                                     const SMESH_Algo* algo    = 0)
@@ -82,19 +85,19 @@ struct SMESH_ComputeError
 
 };
 
-#define case2char(err) case err: return #err;
+#define _case2char(err) case err: return #err;
 
 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_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   );
   default:;
   }
   return "";