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=499f29d24922cec66e41b41a0039a954993bc6df;hpb=deac0e50eb0cac03cef72883584e167fbe4f7d74 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; }