Version: 9.16.0
SMESH_MGLicenseKeyGen.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19// File : SMESH_MGLicenseKeyGen.hxx
20// Created : Sat Jul 31 18:41:04 2021
21// Author : Edward AGAPOV (OCC)
22
23#ifndef __SMESHUtils_MGLicenseKeyGen_HXX__
24#define __SMESHUtils_MGLicenseKeyGen_HXX__
25
26#include "SMESH_Utils.hxx"
27
28#include <string>
29
30#define MESHGEMS_215 (2 << 16 | 15 << 8 | 0)
31
37{
38 // MeshGems 2.13, 2.14 (for CADSurf)
39 SMESHUtils_EXPORT bool SignCAD( void* meshgems_cad, std::string& error );
40
41 // MeshGems 2.15 (for products launched as library)
42 SMESHUtils_EXPORT bool UnlockProduct( const std::string& product, std::string& error );
43
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 );
46
47 // MeshGems 2.13, 2.14 and 2.15 (for products launched as executables)
48 SMESHUtils_EXPORT std::string GetKey(const std::string& gmfFile,
49 int nbVertex,
50 int nbEdge,
51 int nbFace,
52 int nbVol,
53 std::string& error);
54
55 // MeshGems 2.15 (for products launched as library)
56 SMESHUtils_EXPORT std::string GetKey( std::string& error );
57
58 SMESHUtils_EXPORT bool CheckKeyGenLibrary( std::string& error );
59
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);
66}
67
68#endif
#define SMESHUtils_EXPORT
Definition: SMESH_Utils.hxx:37
Manage loading libSalomeMeshGemsKeyGenerator.
Definition: SMESH_MGLicenseKeyGen.cxx:394
bool SetMGSpatialEnvLicense(std::string &error)
Set the SPATIAL_LICENSE environment variable.
Definition: SMESH_MGLicenseKeyGen.cxx:760
int GetMGVersionHex(std::string &error)
Get MeshGems version from the keygen library or meshgems built-in functions.
Definition: SMESH_MGLicenseKeyGen.cxx:691
int GetMGVersionFromEnv(const char *env_variable)
Get MeshGems version major/minor/patch from the environment variables.
Definition: SMESH_MGLicenseKeyGen.cxx:646
std::string GetLibraryName()
Return KeyGenerator library name.
Definition: SMESH_MGLicenseKeyGen.cxx:874
bool UnlockProduct(const std::string &product, std::string &error)
Unlock a specific MeshGems product (for products called as a library)
Definition: SMESH_MGLicenseKeyGen.cxx:442
bool SignCAD(void *meshgems_cad, std::string &error)
Sign a CAD (or don't do it if env MESHGEMS_OLD_STYLE is set)
Definition: SMESH_MGLicenseKeyGen.cxx:488
std::string GetKey(const std::string &gmfFile, int nbVertex, int nbEdge, int nbFace, int nbVol, std::string &error)
Get the license key from libMeshGemsKeyGenerator.so or $SPATIAL_LICENSE Called by plugins calling MG ...
Definition: SMESH_MGLicenseKeyGen.cxx:785
bool CheckKeyGenLibrary(std::string &error)
Return false if libMeshGemsKeyGenerator.so is not functional.
Definition: SMESH_MGLicenseKeyGen.cxx:863
bool NeedsMGSpatialEnvLicense(std::string &error)
Guess if the Spatial license is needed (if MeshGems is > 2.15.0)
Definition: SMESH_MGLicenseKeyGen.cxx:743
bool SignMesh(void *meshgems_mesh, const std::string &product, std::string &error)
Sign a mesh (or don't do it if env MESHGEMS_OLD_STYLE is set)
Definition: SMESH_MGLicenseKeyGen.cxx:551
int GetMGVersionFromFunction(const char *function_name)
Get MeshGems version major/minor/patch from the keygen library and meshgems built-in functions.
Definition: SMESH_MGLicenseKeyGen.cxx:667