mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-07 20:54:16 +05:00
0021980: [CEA 708] Import/export GMF does work only if the file extension is ".mesh"
Notify on a wrong file extesion
This commit is contained in:
parent
d8859cc173
commit
094043665c
@ -24,7 +24,7 @@
|
|||||||
// Author : Edward AGAPOV (eap)
|
// Author : Edward AGAPOV (eap)
|
||||||
|
|
||||||
#include "DriverGMF_Read.hxx"
|
#include "DriverGMF_Read.hxx"
|
||||||
#include "DriverGMF_Write.hxx"
|
#include "DriverGMF.hxx"
|
||||||
|
|
||||||
#include "SMESHDS_Group.hxx"
|
#include "SMESHDS_Group.hxx"
|
||||||
#include "SMESHDS_Mesh.hxx"
|
#include "SMESHDS_Mesh.hxx"
|
||||||
@ -39,13 +39,6 @@ extern "C"
|
|||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------
|
|
||||||
// Closing GMF mesh at destruction
|
|
||||||
DriverGMF_MeshCloser::~DriverGMF_MeshCloser()
|
|
||||||
{
|
|
||||||
if ( _gmfMeshID )
|
|
||||||
GmfCloseMesh( _gmfMeshID );
|
|
||||||
}
|
|
||||||
// --------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------
|
||||||
DriverGMF_Read::DriverGMF_Read():
|
DriverGMF_Read::DriverGMF_Read():
|
||||||
Driver_SMESHDS_Mesh(),
|
Driver_SMESHDS_Mesh(),
|
||||||
@ -74,9 +67,13 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
|
|||||||
// open the file
|
// open the file
|
||||||
int meshID = GmfOpenMesh( myFile.c_str(), GmfRead, &version, &dim );
|
int meshID = GmfOpenMesh( myFile.c_str(), GmfRead, &version, &dim );
|
||||||
if ( !meshID )
|
if ( !meshID )
|
||||||
return addMessage( SMESH_Comment("Can't open for reading ") << myFile, /*fatal=*/true );
|
{
|
||||||
|
if ( DriverGMF::isExtensionCorrect( myFile ))
|
||||||
DriverGMF_MeshCloser aMeshCloser( meshID ); // An object closing GMF mesh at destruction
|
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
|
// Read nodes
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
// Author : Edward AGAPOV (eap)
|
// Author : Edward AGAPOV (eap)
|
||||||
|
|
||||||
#include "DriverGMF_Write.hxx"
|
#include "DriverGMF_Write.hxx"
|
||||||
|
#include "DriverGMF.hxx"
|
||||||
|
|
||||||
#include "SMESHDS_GroupBase.hxx"
|
#include "SMESHDS_GroupBase.hxx"
|
||||||
#include "SMESHDS_Mesh.hxx"
|
#include "SMESHDS_Mesh.hxx"
|
||||||
@ -74,9 +75,14 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
|
|||||||
|
|
||||||
int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
|
int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
|
||||||
if ( !meshID )
|
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
|
// nodes
|
||||||
std::map< const SMDS_MeshNode* , int > node2IdMap;
|
std::map< const SMDS_MeshNode* , int > node2IdMap;
|
||||||
|
Loading…
Reference in New Issue
Block a user