Version: 9.12.0
SMESH_MGLicenseKeyGen.cxx File Reference
#include "SMESH_MGLicenseKeyGen.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_File.hxx"
#include "SMESH_TryCatch.hxx"
#include <Basics_DirUtils.hxx>
#include <Basics_Utils.hxx>
#include <cstdlib>
#include <boost/filesystem.hpp>
#include <boost/regex.hpp>
#include <dlfcn.h>
Include dependency graph for SMESH_MGLicenseKeyGen.cxx:

Namespaces

 SMESHUtils_MGLicenseKeyGen
 Manage loading libSalomeMeshGemsKeyGenerator.
 

Macros

#define LibHandle   void*
 
#define LoadLib(name)   dlopen( name, RTLD_LAZY | RTLD_LOCAL )
 
#define GetProc   dlsym
 
#define UnLoadLib(handle)   dlclose( handle );
 
#define SMESH_CAUGHT   error =
 

Functions

bool SMESHUtils_MGLicenseKeyGen::SignCAD_After (void *meshgems_cad, std::string &error)
 Sign a CAD. More...
 
bool SMESHUtils_MGLicenseKeyGen::UnlockProduct (const std::string &product, std::string &error)
 Unlock a specific MeshGems product (for products called as a library) More...
 
bool SMESHUtils_MGLicenseKeyGen::SignCAD (void *meshgems_cad, std::string &error)
 Sign a CAD (or don't do it if env MESHGEMS_OLD_STYLE is set) More...
 
bool SMESHUtils_MGLicenseKeyGen::SignMesh_After (void *meshgems_mesh, std::string &error)
 Sign a mesh. More...
 
bool SMESHUtils_MGLicenseKeyGen::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) More...
 
std::string SMESHUtils_MGLicenseKeyGen::GetKey_After (const std::string &gmfFile, int nbVertex, int nbEdge, int nbFace, int nbVol, std::string &error)
 Return a license key to pass as argument to a MG mesher executable. More...
 
std::string SMESHUtils_MGLicenseKeyGen::GetKey_After (std::string &error)
 Return a license key to pass as argument to a MG mesher executable (>2.15) More...
 
int SMESHUtils_MGLicenseKeyGen::GetMGVersionFromEnv (const char *env_variable)
 Get MeshGems version major/minor/patch from the environment variables. More...
 
int SMESHUtils_MGLicenseKeyGen::GetMGVersionFromFunction (const char *function_name)
 Get MeshGems version major/minor/patch from the keygen library and meshgems built-in functions. More...
 
int SMESHUtils_MGLicenseKeyGen::GetMGVersionHex (std::string &error)
 Get MeshGems version from the keygen library or meshgems built-in functions. More...
 
bool SMESHUtils_MGLicenseKeyGen::NeedsMGSpatialEnvLicense (std::string &error)
 Guess if the Spatial license is needed (if MeshGems is > 2.15.0) More...
 
bool SMESHUtils_MGLicenseKeyGen::SetMGSpatialEnvLicense (std::string &error)
 Set the SPATIAL_LICENSE environment variable. More...
 
std::string SMESHUtils_MGLicenseKeyGen::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 products as executables. More...
 
std::string SMESHUtils_MGLicenseKeyGen::GetKey (std::string &error)
 Get the license key from libMeshGemsKeyGenerator.so or $SPATIAL_LICENSE Called for MG 2.15 by CADSurf and MG plugins calling MG products as library, i.e. More...
 
bool SMESHUtils_MGLicenseKeyGen::CheckKeyGenLibrary (std::string &error)
 Return false if libMeshGemsKeyGenerator.so is not functional. More...
 
std::string SMESHUtils_MGLicenseKeyGen::GetLibraryName ()
 Return KeyGenerator library name. More...
 

Variables

constexpr char MESHGEMS_OLD_STYLE [] = "MESHGEMS_OLD_STYLE"
 
constexpr char SPATIAL_LICENSE [] = "SPATIAL_LICENSE"
 

Macro Definition Documentation

◆ GetProc

#define GetProc   dlsym

◆ LibHandle

#define LibHandle   void*

◆ LoadLib

#define LoadLib (   name)    dlopen( name, RTLD_LAZY | RTLD_LOCAL )

◆ SMESH_CAUGHT

#define SMESH_CAUGHT   error =

◆ UnLoadLib

#define UnLoadLib (   handle)    dlclose( handle );

Variable Documentation

◆ MESHGEMS_OLD_STYLE

constexpr char MESHGEMS_OLD_STYLE[] = "MESHGEMS_OLD_STYLE"
constexpr

◆ SPATIAL_LICENSE

constexpr char SPATIAL_LICENSE[] = "SPATIAL_LICENSE"
constexpr