X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2FSMeshHelper.cxx;h=7b9c7b1e6932c2df3718b108b796f96070423822;hp=ee2d54b05f57210512fe23eccb0696af91b19bcc;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=54d6af9301c07f47a988dc85864b24b7e3fb61d9 diff --git a/src/SMESH_SWIG/SMeshHelper.cxx b/src/SMESH_SWIG/SMeshHelper.cxx index ee2d54b05..7b9c7b1e6 100644 --- a/src/SMESH_SWIG/SMeshHelper.cxx +++ b/src/SMESH_SWIG/SMeshHelper.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2021 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2021-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -21,13 +21,29 @@ #include "SALOME_KernelServices.hxx" -#include "SMESH_Component_Generator.hxx" - #include -std::string BuildSMESHInstanceInternal() +#include +#include + +std::string GetMGLicenseKeyImpl(const char* gmfFile) { - Engines::EngineComponent_var zeRef = RetrieveSMESHInstance(); - CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef); - return std::string(ior.in()); + smIdType nbVertex, nbEdge, nbFace, nbVol; + DriverGMF_Read gmfReader; + gmfReader.SetFile( gmfFile ); + gmfReader.GetMeshInfo( nbVertex, nbEdge, nbFace, nbVol ); + + std::string errorTxt; + std::string key = SMESHUtils_MGLicenseKeyGen::GetKey( gmfFile, + FromSmIdType( nbVertex ), + FromSmIdType( nbEdge ), + FromSmIdType( nbFace ), + FromSmIdType( nbVol ), + errorTxt ); + if ( !errorTxt.empty() ) + { + std::cerr << "Error: Pb with MeshGems license: " << errorTxt << std::endl; + key = "<" + errorTxt + ">"; + } + return key; }