0020511: EDF 1101 SMESH : Add CGNS to Mesh Format Supported

+  virtual void SetMeshName(const std::string& theMeshName);
+  virtual std::string GetMeshName() const;
+  Status addMessage(const std::string& msg, const bool isFatal=false);
This commit is contained in:
eap 2011-08-10 10:09:22 +00:00
parent 109378a75d
commit 6725a9aa57
2 changed files with 41 additions and 0 deletions

View File

@ -26,6 +26,8 @@
//
#include "Driver_Mesh.h"
#include <utilities.h>
using namespace std;
Driver_Mesh::Driver_Mesh():
@ -39,8 +41,41 @@ 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);
cout << msg << endl;
return isFatal ? DRS_FAIL : DRS_WARN_SKIP_ELEM;
}

View File

@ -28,6 +28,7 @@
#define _INCLUDE_DRIVER_MESH
#include <string>
#include <vector>
#ifdef WNT
#if defined MESHDRIVER_EXPORTS || defined MeshDriver_EXPORTS
@ -57,11 +58,16 @@ class MESHDRIVER_EXPORT Driver_Mesh
virtual Status Perform() = 0;
void SetMeshId(int theMeshId);
void SetFile(const std::string& theFileName);
virtual void SetMeshName(const std::string& theMeshName);
virtual std::string GetMeshName() const;
protected:
std::string myFile;
std::string myMeshName;
int myMeshId;
Status addMessage(const std::string& msg, const bool isFatal=false);
std::vector< std::string > myErrorMessages;
};
#endif