mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-25 04:00:33 +05:00
parent
499331b207
commit
1ffd1c1245
@ -44,7 +44,7 @@ namespace SMESHUtils_MGLicenseKeyGen
|
|||||||
int nbVol,
|
int nbVol,
|
||||||
std::string& error);
|
std::string& error);
|
||||||
|
|
||||||
SMESHUtils_EXPORT bool CheckKeyGeLibrary( std::string& error );
|
SMESHUtils_EXPORT bool CheckKeyGenLibrary( std::string& error );
|
||||||
|
|
||||||
SMESHUtils_EXPORT std::string GetLibraryName();
|
SMESHUtils_EXPORT std::string GetLibraryName();
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ include_directories(
|
|||||||
${PROJECT_SOURCE_DIR}/src/SMDS
|
${PROJECT_SOURCE_DIR}/src/SMDS
|
||||||
${PROJECT_SOURCE_DIR}/src/SMESH
|
${PROJECT_SOURCE_DIR}/src/SMESH
|
||||||
${PROJECT_SOURCE_DIR}/src/SMESH_I
|
${PROJECT_SOURCE_DIR}/src/SMESH_I
|
||||||
|
${PROJECT_SOURCE_DIR}/src/Driver
|
||||||
|
${PROJECT_SOURCE_DIR}/src/DriverGMF
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${PROJECT_BINARY_DIR}/idl
|
${PROJECT_BINARY_DIR}/idl
|
||||||
)
|
)
|
||||||
@ -123,7 +125,7 @@ IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
|
|||||||
ELSE()
|
ELSE()
|
||||||
SWIG_ADD_LIBRARY(SMeshHelper LANGUAGE python SOURCES ${SMeshHelper_SOURCES})
|
SWIG_ADD_LIBRARY(SMeshHelper LANGUAGE python SOURCES ${SMeshHelper_SOURCES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SWIG_LINK_LIBRARIES(SMeshHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SMESHEngine )
|
SWIG_LINK_LIBRARIES(SMeshHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SMESHEngine MeshDriverGMF )
|
||||||
SWIG_CHECK_GENERATION(SMeshHelper)
|
SWIG_CHECK_GENERATION(SMeshHelper)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET_TARGET_PROPERTIES(_SMeshHelper PROPERTIES DEBUG_OUTPUT_NAME _SMeshHelper_d)
|
SET_TARGET_PROPERTIES(_SMeshHelper PROPERTIES DEBUG_OUTPUT_NAME _SMeshHelper_d)
|
||||||
|
@ -25,9 +25,35 @@
|
|||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include <DriverGMF_Read.hxx>
|
||||||
|
#include <SMESH_MGLicenseKeyGen.hxx>
|
||||||
|
|
||||||
|
|
||||||
std::string BuildSMESHInstanceInternal()
|
std::string BuildSMESHInstanceInternal()
|
||||||
{
|
{
|
||||||
Engines::EngineComponent_var zeRef = RetrieveSMESHInstance();
|
Engines::EngineComponent_var zeRef = RetrieveSMESHInstance();
|
||||||
CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
|
CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
|
||||||
return std::string(ior.in());
|
return std::string(ior.in());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetMGLicenseKeyImpl(const char* gmfFile)
|
||||||
|
{
|
||||||
|
smIdType nbVertex, nbEdge, nbFace, nbVol;
|
||||||
|
DriverGMF_Read gmfReader;
|
||||||
|
gmfReader.SetFile( gmfFile );
|
||||||
|
gmfReader.GetMeshInfo( nbVertex, nbEdge, nbFace, nbVol );
|
||||||
|
|
||||||
|
std::string errorTxt;
|
||||||
|
std::string key = SMESHUtils_MGLicenseKeyGen::GetKey( gmfFile,
|
||||||
|
FromSmIdType<int>( nbVertex ),
|
||||||
|
FromSmIdType<int>( nbEdge ),
|
||||||
|
FromSmIdType<int>( nbFace ),
|
||||||
|
FromSmIdType<int>( nbVol ),
|
||||||
|
errorTxt );
|
||||||
|
if ( !errorTxt.empty() )
|
||||||
|
{
|
||||||
|
std::cerr << "Error: Pb with MeshGens license: " << errorTxt << std::endl;
|
||||||
|
key = "<" + errorTxt + ">";
|
||||||
|
}
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
@ -22,3 +22,5 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::string BuildSMESHInstanceInternal();
|
std::string BuildSMESHInstanceInternal();
|
||||||
|
|
||||||
|
std::string GetMGLicenseKeyImpl(const char* gmfFile);
|
||||||
|
@ -31,4 +31,9 @@
|
|||||||
{
|
{
|
||||||
return BuildSMESHInstanceInternal();
|
return BuildSMESHInstanceInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetMGLicenseKey(const char* gmfFile)
|
||||||
|
{
|
||||||
|
return GetMGLicenseKeyImpl( gmfFile );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -577,6 +577,11 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
|
|||||||
if not self.CB_ComputedOverlapDistance.isChecked(): #computed default
|
if not self.CB_ComputedOverlapDistance.isChecked(): #computed default
|
||||||
self.commande+=" --overlap_distance " + self.SP_toStr(self.SP_OverlapDistance)
|
self.commande+=" --overlap_distance " + self.SP_toStr(self.SP_OverlapDistance)
|
||||||
self.commande+=" --overlap_angle " + str(self.SP_OverlapAngle.value())
|
self.commande+=" --overlap_angle " + str(self.SP_OverlapAngle.value())
|
||||||
|
|
||||||
|
import SMeshHelper
|
||||||
|
key = SMeshHelper.GetMGLicenseKey( self.self.fichierIn )
|
||||||
|
self.commande+=' --key ' + key
|
||||||
|
|
||||||
if verbose: print(("INFO: MGCCleaner command:\n %s" % self.commande))
|
if verbose: print(("INFO: MGCCleaner command:\n %s" % self.commande))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -545,6 +545,10 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
|
|||||||
|
|
||||||
self.commande+=' --in "' + self.fichierIn +'"'
|
self.commande+=' --in "' + self.fichierIn +'"'
|
||||||
self.commande+=' --out "' + self.fichierOut +'"'
|
self.commande+=' --out "' + self.fichierOut +'"'
|
||||||
|
|
||||||
|
import SMeshHelper
|
||||||
|
key = SMeshHelper.GetMGLicenseKey( self.fichierIn )
|
||||||
|
self.commande+=' --key ' + key
|
||||||
|
|
||||||
print(self.commande)
|
print(self.commande)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user