// Author : Edward AGAPOV (eap)
#include "DriverGMF_Read.hxx"
-#include "DriverGMF_Write.hxx"
+#include "DriverGMF.hxx"
#include "SMESHDS_Group.hxx"
#include "SMESHDS_Mesh.hxx"
#include <stdarg.h>
-// --------------------------------------------------------------------------------
-// Closing GMF mesh at destruction
-DriverGMF_MeshCloser::~DriverGMF_MeshCloser()
-{
- if ( _gmfMeshID )
- GmfCloseMesh( _gmfMeshID );
-}
// --------------------------------------------------------------------------------
DriverGMF_Read::DriverGMF_Read():
Driver_SMESHDS_Mesh(),
// open the file
int meshID = GmfOpenMesh( myFile.c_str(), GmfRead, &version, &dim );
if ( !meshID )
- return addMessage( SMESH_Comment("Can't open for reading ") << myFile, /*fatal=*/true );
-
- DriverGMF_MeshCloser aMeshCloser( meshID ); // An object closing GMF mesh at destruction
+ {
+ if ( DriverGMF::isExtensionCorrect( myFile ))
+ return addMessage( SMESH_Comment("Can't open for reading ") << myFile, /*fatal=*/true );
+ else
+ return addMessage( SMESH_Comment("Not '.mesh' or '.meshb' extension of file ") << myFile, /*fatal=*/true );
+ }
+ DriverGMF::MeshCloser aMeshCloser( meshID ); // An object closing GMF mesh at destruction
// Read nodes
// Author : Edward AGAPOV (eap)
#include "DriverGMF_Write.hxx"
+#include "DriverGMF.hxx"
#include "SMESHDS_GroupBase.hxx"
#include "SMESHDS_Mesh.hxx"
int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
if ( !meshID )
- return addMessage( SMESH_Comment("Can't open for writing ") << myFile, /*fatal=*/true );
+ {
+ if ( DriverGMF::isExtensionCorrect( myFile ))
+ return addMessage( SMESH_Comment("Can't open for writing ") << myFile, /*fatal=*/true );
+ else
+ return addMessage( SMESH_Comment("Not '.mesh' or '.meshb' extension of file ") << myFile, /*fatal=*/true );
+ }
- DriverGMF_MeshCloser aMeshCloser( meshID ); // An object closing GMF mesh at destruction
+ DriverGMF::MeshCloser aMeshCloser( meshID ); // An object closing GMF mesh at destruction
// nodes
std::map< const SMDS_MeshNode* , int > node2IdMap;