Salome HOME
Update of CheckDone
[modules/smesh.git] / src / SMESHUtils / SMESH_MGLicenseKeyGen.hxx
1 // Copyright (C) 2007-2024  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
32 /*!
33  * \brief Manage loading libSalomeMeshGemsKeyGenerator.[so|dll] and sing MeshGems CAD or mesh
34  */
35
36 namespace SMESHUtils_MGLicenseKeyGen
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
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);
66 }
67
68 #endif