Salome HOME
bos #24596 [CEA] New MeshGems license
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_BLSURF.cxx
index 6e30bcaa83681fb42d766085af953dcbc419bea3..68ffe3eedd1ea153aecb52a53f2ca37effaf7064 100644 (file)
@@ -42,6 +42,7 @@ extern "C"{
 #include <SMESHDS_Group.hxx>
 #include <SMESH_Gen.hxx>
 #include <SMESH_Group.hxx>
+#include <SMESH_MGLicenseKeyGen.hxx>
 #include <SMESH_Mesh.hxx>
 #include <SMESH_MeshEditor.hxx>
 #include <SMESH_MesherHelper.hxx>
@@ -1011,7 +1012,7 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp,
   //set_param(css, "process_3d_topology",    _precadProcess3DTopology ? "1" : "0");
   //set_param(css, "discard_input_topology", _precadDiscardInput ? "1" : "0");
   //set_param(css, "max_number_of_points_per_patch", "1000000");
-  
+
    bool useGradation = false;
    switch (_physicalMesh)
    {
@@ -1485,7 +1486,7 @@ namespace
         //       distene_sizemap_delete(iso_sizemap_e);
         //     if(iso_sizemap_f)
         //       distene_sizemap_delete(iso_sizemap_f);
-        // 
+        //
         // //     if(clean_geo_sizemap_e)
         // //       distene_sizemap_delete(clean_geo_sizemap_e);
         // //     if(clean_geo_sizemap_f)
@@ -2505,7 +2506,10 @@ bool BLSURFPlugin_BLSURF::compute(SMESH_Mesh&         aMesh,
   // TODO: be able to use a mesh in input.
   // See imsh usage in Products/templates/mg-cadsurf_template_common.cpp
   // => cadsurf_set_mesh
-    
+  std::string errorTxt;
+  if ( !SMESHUtils_MGLicenseKeyGen::SignCAD( c, errorTxt ))
+    return error( "Problem with library SalomeMeshGemsKeyGenerator: " + errorTxt );
+
   // Use the original dcad
   cadsurf_set_dcad(css, dcad);
 
@@ -3032,6 +3036,10 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelpe
       meshgems_mesh_set_quadrangle_vertices( msh, iQ++, nodeIDs );
   }
 
+  std::string errorTxt;
+  if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( msh, errorTxt ))
+    return error( "Problem with library SalomeMeshGemsKeyGenerator: " + errorTxt );
+
   ret = cadsurf_set_mesh(css, msh);
   if ( ret != STATUS_OK ) return error("Pb in cadsurf_set_mesh()");