mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 10:08:34 +05:00
0021980: [CEA 708] Import/export GMF does work only if the file extension is ".mesh"
This commit is contained in:
parent
094043665c
commit
b35b22be34
66
src/DriverGMF/DriverGMF.cxx
Normal file
66
src/DriverGMF/DriverGMF.cxx
Normal file
@ -0,0 +1,66 @@
|
||||
// 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
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// File : DriverGMF.hxx
|
||||
// Created : Thu Nov 15 16:45:58 2012
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
#include "DriverGMF.hxx"
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "libmesh5.h"
|
||||
}
|
||||
|
||||
namespace DriverGMF
|
||||
{
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Closes GMF mesh at destruction
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
MeshCloser::~MeshCloser()
|
||||
{
|
||||
if ( _gmfMeshID )
|
||||
GmfCloseMesh( _gmfMeshID );
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Checks GMF file extension
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
bool isExtensionCorrect( const std::string& fileName )
|
||||
{
|
||||
std::string ext = boost::filesystem::extension(fileName);
|
||||
switch ( ext.size() ) {
|
||||
case 5: return ( ext == ".mesh" || ext == ".solb" );
|
||||
case 6: return ( ext == ".meshb" );
|
||||
case 4: return ( ext == ".sol" );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
46
src/DriverGMF/DriverGMF.hxx
Normal file
46
src/DriverGMF/DriverGMF.hxx
Normal file
@ -0,0 +1,46 @@
|
||||
// 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
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// File : DriverGMF.hxx
|
||||
// Created : Thu Nov 15 16:45:58 2012
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
#ifndef __DriverGMF_HXX__
|
||||
#define __DriverGMF_HXX__
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace DriverGMF
|
||||
{
|
||||
/*!
|
||||
* \brief An object closing GMF mesh at destruction
|
||||
*/
|
||||
struct MeshCloser
|
||||
{
|
||||
int _gmfMeshID;
|
||||
MeshCloser( const int gmfMeshID ): _gmfMeshID(gmfMeshID) {}
|
||||
~MeshCloser();
|
||||
};
|
||||
|
||||
bool isExtensionCorrect( const std::string& fileName );
|
||||
}
|
||||
|
||||
#endif
|
@ -54,15 +54,4 @@ public:
|
||||
bool _exportRequiredGroups;
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief An object closing GMF mesh at destruction
|
||||
*/
|
||||
struct DriverGMF_MeshCloser
|
||||
{
|
||||
int _gmfMeshID;
|
||||
DriverGMF_MeshCloser( const int gmfMeshID ): _gmfMeshID(gmfMeshID) {}
|
||||
~DriverGMF_MeshCloser();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user