From: Christophe Bourcier Date: Tue, 7 Mar 2023 14:19:25 +0000 (+0100) Subject: Upgrade to new MG license mechanism and keep compatibility with old ones X-Git-Tag: V9_11_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3b62ed45e06642c141d2764e0815fd6306d49e60;p=plugins%2Fghs3dprlplugin.git Upgrade to new MG license mechanism and keep compatibility with old ones --- diff --git a/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx b/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx index 01563a4..cb348a5 100644 --- a/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx +++ b/src/GHS3DPRLPlugin/MG_TetraHPC_API.cxx @@ -588,14 +588,28 @@ bool MG_TetraHPC_API::LibData::Compute( const std::string& outFile ) { // MG license std::string errorTxt; + status_t ret; +#if MESHGEMS_VERSION_HEX > MESHGEMS_215 + // need to unlock Tetra license only once + std::string SPATIAL_LICENSE = SMESHUtils_MGLicenseKeyGen::GetKey(errorTxt); + ret = meshgems_tetra_hpc_unlock_product(SPATIAL_LICENSE.c_str()); + if STATUS_IS_ERROR( ret ) + { + AddError( SMESH_Comment( "Problem with SPATIAL_LICENSE to unlock Tetra_HPC: ") << errorTxt ); + return false; + } + else + MESSAGE("SPATIAL_LICENSE unlock Tetra_HPC: " << ret); +#else if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( _tria_mesh, errorTxt )) { AddError( SMESH_Comment( "Problem with library SalomeMeshGemsKeyGenerator: ") << errorTxt ); return false; } +#endif // Set surface mesh - status_t ret = tetra_hpc_set_input_mesh( _session, _tria_mesh ); + ret = tetra_hpc_set_input_mesh( _session, _tria_mesh ); if ( ret != STATUS_OK ) MG_Error( "unable to set surface mesh"); // // Set a sizemap