1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : SMESH_MGLicenseKeyGen.hxx
20 // Created : Sat Jul 31 18:41:04 2021
21 // Author : Edward AGAPOV (OCC)
23 #ifndef __SMESHUtils_MGLicenseKeyGen_HXX__
24 #define __SMESHUtils_MGLicenseKeyGen_HXX__
26 #include "SMESH_Utils.hxx"
30 #define MESHGEMS_215 (2 << 16 | 15 << 8 | 0)
33 * \brief Manage loading libSalomeMeshGemsKeyGenerator.[so|dll] and sing MeshGems CAD or mesh
36 namespace SMESHUtils_MGLicenseKeyGen
38 // MeshGems 2.13, 2.14 (for CADSurf)
39 SMESHUtils_EXPORT bool SignCAD( void* meshgems_cad, std::string& error );
41 // MeshGems 2.15 (for products launched as library)
42 SMESHUtils_EXPORT bool UnlockProduct( const std::string& product, std::string& error );
44 // MeshGems 2.13, 2.14 (for products launched as library)
45 SMESHUtils_EXPORT bool SignMesh( void* meshgems_mesh, const std::string& product, std::string& error );
47 // MeshGems 2.13, 2.14 and 2.15 (for products launched as executables)
48 SMESHUtils_EXPORT std::string GetKey(const std::string& gmfFile,
55 // MeshGems 2.15 (for products launched as library)
56 SMESHUtils_EXPORT std::string GetKey( std::string& error );
58 SMESHUtils_EXPORT bool CheckKeyGenLibrary( std::string& error );
60 SMESHUtils_EXPORT std::string GetLibraryName();
61 SMESHUtils_EXPORT int GetMGVersionFromFunction(const char* function_name);
62 SMESHUtils_EXPORT int GetMGVersionFromEnv(const char* env_variable);
63 SMESHUtils_EXPORT int GetMGVersionHex(std::string& error);
64 SMESHUtils_EXPORT bool NeedsMGSpatialEnvLicense(std::string& error);
65 SMESHUtils_EXPORT bool SetMGSpatialEnvLicense(std::string& error);