Salome HOME
Update copyright information
[modules/smesh.git] / src / Driver / Driver_Mesh.cxx
index 7ab7387c0043a447177feff5d98859a56c7c538f..73895176fe7faa33672b36a5a1c9221a762de713 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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
@@ -26,6 +26,8 @@
 //
 #include "Driver_Mesh.h"
 
+#include <utilities.h>
+
 using namespace std;
 
 Driver_Mesh::Driver_Mesh():
@@ -39,8 +41,42 @@ void Driver_Mesh::SetMeshId(int theMeshId)
   myMeshId = theMeshId;
 }
 
+void Driver_Mesh::SetMeshName(const std::string& theMeshName)
+{
+  myMeshName = theMeshName;
+}
+
+std::string Driver_Mesh::GetMeshName() const
+{
+  return myMeshName;
+}
+
 
 void Driver_Mesh::SetFile(const std::string& theFileName)
 {
   myFile = theFileName;
 }
+
+
+//================================================================================
+/*!
+ * \brief Stores an error message
+ *
+ * We consider an error fatal if none mesh can be read
+ */
+//================================================================================
+
+Driver_Mesh::Status Driver_Mesh::addMessage(const std::string& msg,
+                                            const bool         isFatal/*=false*/)
+{
+  if ( isFatal )
+    myErrorMessages.clear(); // warnings are useless if a fatal error encounters
+
+  myErrorMessages.push_back( msg );
+
+  MESSAGE(msg);
+#ifdef _DEBUG_
+  cout << msg << endl;
+#endif
+  return isFatal ? DRS_FAIL : DRS_WARN_SKIP_ELEM;
+}