X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHexoticPlugin%2FMG_Hexotic_API.cxx;h=a9b713c2f0108a5bb1fabc6b444ce5bb1c924871;hb=a715958b7a16ee5fce6a3b04056228b5182df4e6;hp=d3fda9b0af069c1a14d438ba6f3f759c197a4da2;hpb=61f5866508a334ee45f89ffa9febef261d982b4a;p=plugins%2Fhexoticplugin.git diff --git a/src/HexoticPlugin/MG_Hexotic_API.cxx b/src/HexoticPlugin/MG_Hexotic_API.cxx index d3fda9b..a9b713c 100644 --- a/src/HexoticPlugin/MG_Hexotic_API.cxx +++ b/src/HexoticPlugin/MG_Hexotic_API.cxx @@ -41,6 +41,9 @@ extern "C"{ #include } +#define MESHGEMS_VERSION_HEX (MESHGEMS_VERSION_MAJOR << 16 | MESHGEMS_VERSION_MINOR << 8 | MESHGEMS_VERSION_PATCH) +#define MESHGEMS_215 (2 << 16 | 15 << 8 | 0) + struct MG_Hexotic_API::LibData { // MG objects @@ -672,14 +675,29 @@ bool MG_Hexotic_API::LibData::Compute() { // MG license std::string errorTxt; + status_t ret; + +#if MESHGEMS_VERSION_HEX > MESHGEMS_215 + // unlock Hexa license only once + std::string SPATIAL_LICENSE = SMESHUtils_MGLicenseKeyGen::GetKey(errorTxt); + ret = meshgems_hexa_unlock_product(SPATIAL_LICENSE.c_str()); + if STATUS_IS_ERROR( ret ) + { + AddError( SMESH_Comment( "Problem with SPATIAL_LICENSE to unlock Hexa: ") << errorTxt ); + return false; + } + else + MESSAGE("SPATIAL_LICENSE unlock Hexa: " << 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 = hexa_set_surface_mesh( _session, _tria_mesh ); + ret = hexa_set_surface_mesh( _session, _tria_mesh ); if ( ret != STATUS_OK ) MG_Error( "unable to set surface mesh"); // Set a sizemap