Salome HOME
Improve new MG license mechanism to be binary compatible 2.14/2.15 cbr/new_mg_license_215_v2 V9_11_0a1 V9_11_0a2 V9_11_0b1
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Wed, 19 Apr 2023 12:34:40 +0000 (14:34 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Wed, 19 Apr 2023 12:34:40 +0000 (14:34 +0200)
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx

index 0036e133dc71d35b59613221284ea241a1022a68..711e5e7decdab55713794c8fbc79dac81d2ddf36 100644 (file)
@@ -100,9 +100,6 @@ extern "C"{
 #include <memory>
 #include <functional>
 
-#define MESHGEMS_VERSION_HEX (MESHGEMS_VERSION_MAJOR << 16 | MESHGEMS_VERSION_MINOR << 8 | MESHGEMS_VERSION_PATCH)
-#define MESHGEMS_215 (2 << 16 | 15 << 8 | 0)
-
 using namespace std;
 
 /* ==================================
@@ -2535,19 +2532,8 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
     // set_param(css, "max_size",             val_to_string( minFaceSize * 5 ).c_str());
   }
   std::string errorTxt;
-#if MESHGEMS_VERSION_HEX > MESHGEMS_215
-  MESSAGE("MeshGems > 2.15.0");
-  MESSAGE("=> unlock CADSurf with SPATIAL_LICENSE key");
-  std::string SPATIAL_LICENSE = SMESHUtils_MGLicenseKeyGen::GetKey(errorTxt);
-  status = meshgems_cadsurf_unlock_product(SPATIAL_LICENSE.c_str());
-  if STATUS_IS_ERROR( status )
-    return error( status, "Problem with SPATIAL_LICENSE to unlock CADSurf: " + errorTxt);
-#else
-  MESSAGE("MeshGems < 2.15.0");
-  MESSAGE("=> Sign the CAD with its info");
   if ( !SMESHUtils_MGLicenseKeyGen::SignCAD( c, errorTxt ))
     return error( "Problem with library SalomeMeshGemsKeyGenerator: " + errorTxt );
-#endif
 
   // Use the original dcad
   cadsurf_set_dcad(css, dcad);
@@ -3094,19 +3080,9 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelpe
   }
 
   std::string errorTxt;
-#if MESHGEMS_VERSION_HEX > MESHGEMS_215
-  MESSAGE("MeshGems > 2.15.0");
-  MESSAGE("=> unlock CADSurf discrete with SPATIAL_LICENSE key");
-  std::string SPATIAL_LICENSE = SMESHUtils_MGLicenseKeyGen::GetKey(errorTxt);
-  ret = meshgems_cadsurf_unlock_product(SPATIAL_LICENSE.c_str());
-  if STATUS_IS_ERROR( ret )
-    return error( ret, "Problem with SPATIAL_LICENSE to unlock CADSurf discrete: " + errorTxt);
-#else
-  MESSAGE("MeshGems < 2.15.0");
-  MESSAGE("=> Sign the mesh with its info");
-  if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( msh, errorTxt ))
+
+  if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( msh, "cadsurf", errorTxt ))
     return error( "Problem with library SalomeMeshGemsKeyGenerator: " + errorTxt );
-#endif
 
   ret = cadsurf_set_mesh(css, msh);
   if ( ret != STATUS_OK ) return error("Pb in cadsurf_set_mesh()");