mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 02:10:35 +05:00
021382: EDF 1985 SMESH: Read/write of .mesh files (GMF format)
+ virtual void SetOption(const std::string& optionName, + const std::string& optionValue) {} + virtual SMESH_ComputeErrorPtr GetError();
This commit is contained in:
parent
673b8a1d41
commit
553185b191
@ -26,13 +26,16 @@
|
||||
//
|
||||
#include "Driver_Mesh.h"
|
||||
|
||||
#include "SMESH_Comment.hxx"
|
||||
|
||||
#include <utilities.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
Driver_Mesh::Driver_Mesh():
|
||||
myFile(""),
|
||||
myMeshId(-1)
|
||||
myMeshId(-1),
|
||||
myStatus( DRS_OK )
|
||||
{}
|
||||
|
||||
|
||||
@ -78,5 +81,23 @@ Driver_Mesh::Status Driver_Mesh::addMessage(const std::string& msg,
|
||||
#ifdef _DEBUG_
|
||||
cout << msg << endl;
|
||||
#endif
|
||||
return isFatal ? DRS_FAIL : DRS_WARN_SKIP_ELEM;
|
||||
return ( myStatus = isFatal ? DRS_FAIL : DRS_WARN_SKIP_ELEM );
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return a structure containing description of errors
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
SMESH_ComputeErrorPtr Driver_Mesh::GetError()
|
||||
{
|
||||
SMESH_Comment msg;
|
||||
for ( size_t i = 0; i < myErrorMessages.size(); ++i )
|
||||
{
|
||||
msg << myErrorMessages[i];
|
||||
if ( i+1 < myErrorMessages.size() )
|
||||
msg << "\n";
|
||||
}
|
||||
return SMESH_ComputeError::New( myStatus == DRS_OK ? int(COMPERR_OK) : int(myStatus), msg );
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
#ifndef _INCLUDE_DRIVER_MESH
|
||||
#define _INCLUDE_DRIVER_MESH
|
||||
|
||||
#include "SMESH_ComputeError.hxx"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -55,12 +57,18 @@ class MESHDRIVER_EXPORT Driver_Mesh
|
||||
DRS_FAIL // general failure (exception etc.)
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
virtual void SetOption(const std::string& optionName,
|
||||
const std::string& optionValue) {}
|
||||
|
||||
virtual Status Perform() = 0;
|
||||
|
||||
virtual SMESH_ComputeErrorPtr GetError();
|
||||
|
||||
protected:
|
||||
std::string myFile;
|
||||
std::string myMeshName;
|
||||
@ -68,6 +76,7 @@ class MESHDRIVER_EXPORT Driver_Mesh
|
||||
|
||||
Status addMessage(const std::string& msg, const bool isFatal=false);
|
||||
std::vector< std::string > myErrorMessages;
|
||||
Status myStatus;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user