From: Anthony Geay Date: Thu, 10 Feb 2022 13:25:46 +0000 (+0100) Subject: First try to mix old style and new style meshgems X-Git-Tag: V9_8_0_1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5c310521817c7457f7c3e244bf6c00eba70e6fc4;p=modules%2Fsmesh.git First try to mix old style and new style meshgems --- diff --git a/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx b/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx index b058e86a2..1592f9c88 100644 --- a/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx +++ b/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx @@ -60,6 +60,8 @@ namespace boofs = boost::filesystem; #undef SMESH_CAUGHT #define SMESH_CAUGHT error = +constexpr char MESHGEMS_OLD_STYLE[] = "MESHGEMS_OLD_STYLE"; + namespace { @@ -372,7 +374,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation */ //================================================================================ - bool SignCAD( void* meshgems_cad, std::string& error ) + bool SignCAD_After( void* meshgems_cad, std::string& error ) { LibraryFile libraryFile; if ( !loadLibrary( error, libraryFile )) @@ -401,6 +403,15 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation } return ok; } + + bool SignCAD( void* meshgems_cad, std::string& error ) + { + const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) ); + if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ) + return SignCAD_After(meshgems_cad, error); + else + return true; + } //================================================================================ /*! @@ -411,7 +422,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation */ //================================================================================ - bool SignMesh( void* meshgems_mesh, std::string& error ) + bool SignMesh_After( void* meshgems_mesh, std::string& error ) { LibraryFile libraryFile; if ( !loadLibrary( error, libraryFile )) @@ -440,6 +451,15 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation } return ok; } + + bool SignMesh( void* meshgems_mesh, std::string& error ) + { + const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) ); + if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ) + return SignMesh_After(meshgems_mesh, error); + else + return true; + } //================================================================================ /*! @@ -451,12 +471,12 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation */ //================================================================================ - std::string GetKey(const std::string& gmfFile, - int nbVertex, - int nbEdge, - int nbFace, - int nbVol, - std::string& error) + std::string GetKey_After(const std::string& gmfFile, + int nbVertex, + int nbEdge, + int nbFace, + int nbVol, + std::string& error) { std::string key; LibraryFile libraryFile; @@ -480,6 +500,20 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation return key; } + std::string GetKey(const std::string& gmfFile, + int nbVertex, + int nbEdge, + int nbFace, + int nbVol, + std::string& error) + { + const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) ); + if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 ) + return GetKey_After(gmfFile,nbVertex,nbEdge,nbFace,nbVol,error); + else + return std::string("0"); + } + //================================================================================ /*! * \brief Return false if libMeshGemsKeyGenerator.so is not functional