Salome HOME
updated copyright message
[plugins/hybridplugin.git] / src / HYBRIDPlugin / MG_HYBRID_API.cxx
index b0f2f9d53dd5c89f646a05b2ca5c6b203a0b0172..3288283bfe72ec32c432576f873da4d8595b7eb1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2004-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2004-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -698,14 +698,16 @@ bool MG_HYBRID_API::LibData::Compute()
 {
   // MG license
   std::string errorTxt;
-  if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( _surf_mesh, errorTxt ))
+  status_t ret;
+
+  if ( !SMESHUtils_MGLicenseKeyGen::SignMesh( _surf_mesh, "hybrid", errorTxt ))
   {
     AddError( SMESH_Comment( "Problem with library SalomeMeshGemsKeyGenerator: ") << errorTxt );
     return false;
   }
 
   // Set surface mesh
-  status_t ret = hybrid_set_surface_mesh( _session, _surf_mesh );
+  ret = hybrid_set_surface_mesh( _session, _surf_mesh );
   if ( ret != STATUS_OK ) MG_Error( "unable to set surface mesh");
 
 #ifndef WIN32
@@ -873,8 +875,8 @@ bool MG_HYBRID_API::Compute( const std::string& cmdLine, std::string& errStr )
       errStr = "Problem with library SalomeMeshGemsKeyGenerator: " + errorTxt;
       return false;
     }
-
-    const_cast< std::string& >( cmdLine ) += " --key " + key;
+    if ( key != "0")
+      const_cast< std::string& >( cmdLine ) += " --key " + key;
   }
 
   int err = system( cmdLine.c_str() ); // run
@@ -1176,9 +1178,10 @@ void MG_HYBRID_API::GmfSetKwd(int iMesh, GmfKwdCod what, int nb )
   if ( iMesh == 1 )
   {
     switch ( what ) {
-    case GmfVertices:  _nbNodes = nb; break;
-    case GmfEdges:     _nbEdges = nb; break;
-    case GmfTriangles: _nbFaces = nb; break;
+    case GmfVertices:       _nbNodes = nb; break;
+    case GmfEdges:          _nbEdges = nb; break;
+    case GmfTriangles:      _nbFaces += nb; break;
+    case GmfQuadrilaterals: _nbFaces += nb; break;
     default:;
     }
   }