mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 01:40:33 +05:00
First try to mix old style and new style meshgems
This commit is contained in:
parent
385b688f73
commit
e1682190e9
@ -60,6 +60,8 @@ namespace boofs = boost::filesystem;
|
|||||||
#undef SMESH_CAUGHT
|
#undef SMESH_CAUGHT
|
||||||
#define SMESH_CAUGHT error =
|
#define SMESH_CAUGHT error =
|
||||||
|
|
||||||
|
constexpr char MESHGEMS_OLD_STYLE[] = "MESHGEMS_OLD_STYLE";
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -372,7 +374,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
bool SignCAD( void* meshgems_cad, std::string& error )
|
bool SignCAD_After( void* meshgems_cad, std::string& error )
|
||||||
{
|
{
|
||||||
LibraryFile libraryFile;
|
LibraryFile libraryFile;
|
||||||
if ( !loadLibrary( error, libraryFile ))
|
if ( !loadLibrary( error, libraryFile ))
|
||||||
@ -402,6 +404,15 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SignCAD( void* meshgems_cad, std::string& error )
|
||||||
|
{
|
||||||
|
const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) );
|
||||||
|
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 )
|
||||||
|
return SignCAD_After(meshgems_cad, error);
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Sign a mesh
|
* \brief Sign a mesh
|
||||||
@ -411,7 +422,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
bool SignMesh( void* meshgems_mesh, std::string& error )
|
bool SignMesh_After( void* meshgems_mesh, std::string& error )
|
||||||
{
|
{
|
||||||
LibraryFile libraryFile;
|
LibraryFile libraryFile;
|
||||||
if ( !loadLibrary( error, libraryFile ))
|
if ( !loadLibrary( error, libraryFile ))
|
||||||
@ -441,6 +452,15 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SignMesh( void* meshgems_mesh, std::string& error )
|
||||||
|
{
|
||||||
|
const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) );
|
||||||
|
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 )
|
||||||
|
return SignMesh_After(meshgems_mesh, error);
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Return a license key to pass as argument to a MG mesher executable
|
* \brief Return a license key to pass as argument to a MG mesher executable
|
||||||
@ -451,7 +471,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
std::string GetKey(const std::string& gmfFile,
|
std::string GetKey_After(const std::string& gmfFile,
|
||||||
int nbVertex,
|
int nbVertex,
|
||||||
int nbEdge,
|
int nbEdge,
|
||||||
int nbFace,
|
int nbFace,
|
||||||
@ -480,6 +500,20 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation
|
|||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetKey(const std::string& gmfFile,
|
||||||
|
int nbVertex,
|
||||||
|
int nbEdge,
|
||||||
|
int nbFace,
|
||||||
|
int nbVol,
|
||||||
|
std::string& error)
|
||||||
|
{
|
||||||
|
const char *meshGemsOldStyleEnvVar( getenv( MESHGEMS_OLD_STYLE ) );
|
||||||
|
if ( !meshGemsOldStyleEnvVar || strlen(meshGemsOldStyleEnvVar) == 0 )
|
||||||
|
return GetKey_After(gmfFile,nbVertex,nbEdge,nbFace,nbVol,error);
|
||||||
|
else
|
||||||
|
return std::string("0");
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Return false if libMeshGemsKeyGenerator.so is not functional
|
* \brief Return false if libMeshGemsKeyGenerator.so is not functional
|
||||||
|
Loading…
Reference in New Issue
Block a user