int nbVol,
std::string& error);
- SMESHUtils_EXPORT bool CheckKeyGeLibrary( std::string& error );
+ SMESHUtils_EXPORT bool CheckKeyGenLibrary( std::string& error );
SMESHUtils_EXPORT std::string GetLibraryName();
}
${PROJECT_SOURCE_DIR}/src/SMDS
${PROJECT_SOURCE_DIR}/src/SMESH
${PROJECT_SOURCE_DIR}/src/SMESH_I
+ ${PROJECT_SOURCE_DIR}/src/Driver
+ ${PROJECT_SOURCE_DIR}/src/DriverGMF
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_BINARY_DIR}/idl
)
ELSE()
SWIG_ADD_LIBRARY(SMeshHelper LANGUAGE python SOURCES ${SMeshHelper_SOURCES})
ENDIF()
-SWIG_LINK_LIBRARIES(SMeshHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SMESHEngine )
+SWIG_LINK_LIBRARIES(SMeshHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} SMESHEngine MeshDriverGMF )
SWIG_CHECK_GENERATION(SMeshHelper)
IF(WIN32)
SET_TARGET_PROPERTIES(_SMeshHelper PROPERTIES DEBUG_OUTPUT_NAME _SMeshHelper_d)
#include <cstring>
+#include <DriverGMF_Read.hxx>
+#include <SMESH_MGLicenseKeyGen.hxx>
+
+
std::string BuildSMESHInstanceInternal()
{
Engines::EngineComponent_var zeRef = RetrieveSMESHInstance();
CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
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;
+}
#include <string>
std::string BuildSMESHInstanceInternal();
+
+std::string GetMGLicenseKeyImpl(const char* gmfFile);
{
return BuildSMESHInstanceInternal();
}
+
+ std::string GetMGLicenseKey(const char* gmfFile)
+ {
+ return GetMGLicenseKeyImpl( gmfFile );
+ }
}
if not self.CB_ComputedOverlapDistance.isChecked(): #computed default
self.commande+=" --overlap_distance " + self.SP_toStr(self.SP_OverlapDistance)
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))
return True
self.commande+=' --in "' + self.fichierIn +'"'
self.commande+=' --out "' + self.fichierOut +'"'
+
+ import SMeshHelper
+ key = SMeshHelper.GetMGLicenseKey( self.fichierIn )
+ self.commande+=' --key ' + key
print(self.commande)
return True