]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Make the visualisation work with SSL gui mode agy/archi5_integ
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 24 Feb 2021 16:05:37 +0000 (17:05 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 24 Feb 2021 16:05:37 +0000 (17:05 +0100)
src/SMESHClient/CMakeLists.txt
src/SMESHClient/SMESH_Client.cxx
src/SMESH_I/SMESH_Component_Generator.cxx
src/SMESH_I/SMESH_Component_Generator.hxx

index 1e67b66241d336bfb35cb960c904764ba7b2fa12..6712177e9955dd4994aa994edbb6174ae73f2dd2 100644 (file)
@@ -36,6 +36,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SMESHDS
   ${PROJECT_SOURCE_DIR}/src/SMESH
   ${PROJECT_SOURCE_DIR}/src/SMESHUtils
+  ${PROJECT_SOURCE_DIR}/src/SMESH_I
   ${PROJECT_BINARY_DIR}/idl
 )
 
index 0c1b1aeabd9e365bac26bb24e5ba8f89825f2a2a..66d071a07614ca97a4f69e2d2a655bb1930979ea 100644 (file)
@@ -28,6 +28,7 @@
 #include "SMESHDS_Mesh.hxx"
 #include "SMESHDS_Script.hxx"
 #include "SMESH_Mesh.hxx"
+#include "SMESH_Component_Generator.hxx"
 
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
@@ -783,26 +784,35 @@ SMESH_Client::GetSMESHGen(CORBA::ORB_ptr theORB,
 {
   static SMESH::SMESH_Gen_var aMeshGen;
 
-  if(CORBA::is_nil(aMeshGen.in())){
+  if(CORBA::is_nil(aMeshGen.in()))
+  {
+    Engines::EngineComponent_var isCompoInSSLMode = GetSMESHInstanceHasThis();
+    if( CORBA::is_nil(isCompoInSSLMode) )
+    {
 #ifdef WIN32
-    long aClientPID = (long)_getpid();
+      long aClientPID = (long)_getpid();
 #else
-    long aClientPID =  (long)getpid();
+      long aClientPID =  (long)getpid();
 #endif
 
-    SALOME_NamingService aNamingService(theORB);
-    SALOME_LifeCycleCORBA aLifeCycleCORBA(&aNamingService);
-    Engines::EngineComponent_var aComponent = aLifeCycleCORBA.FindOrLoad_Component("FactoryServer","SMESH");
-    aMeshGen = SMESH::SMESH_Gen::_narrow(aComponent);
+      SALOME_NamingService aNamingService(theORB);
+      SALOME_LifeCycleCORBA aLifeCycleCORBA(&aNamingService);
+      Engines::EngineComponent_var aComponent = aLifeCycleCORBA.FindOrLoad_Component("FactoryServer","SMESH");
+      aMeshGen = SMESH::SMESH_Gen::_narrow(aComponent);
 
-    std::string aClientHostName = Kernel_Utils::GetHostname();
-    Engines::Container_var aServerContainer = aMeshGen->GetContainerRef();
-    CORBA::String_var aServerHostName = aServerContainer->getHostName();
-    CORBA::Long aServerPID = aServerContainer->getPID();
-    aMeshGen->SetEmbeddedMode((aClientPID == aServerPID) && (aClientHostName == aServerHostName.in()));
+      std::string aClientHostName = Kernel_Utils::GetHostname();
+      Engines::Container_var aServerContainer = aMeshGen->GetContainerRef();
+      CORBA::String_var aServerHostName = aServerContainer->getHostName();
+      CORBA::Long aServerPID = aServerContainer->getPID();
+      aMeshGen->SetEmbeddedMode((aClientPID == aServerPID) && (aClientHostName == aServerHostName.in()));
+    }
+    else
+    {
+      aMeshGen = SMESH::SMESH_Gen::_narrow(isCompoInSSLMode);
+    }
+    
   }
   theIsEmbeddedMode = aMeshGen->IsEmbeddedMode();
-
   return aMeshGen;
 }
 
index d4d6a747a00dec7b1ae8248740bad551949658e4..a1819c5e1be469223061c286349c96e472d74352 100644 (file)
@@ -53,3 +53,8 @@ Engines::EngineComponent_var RetrieveSMESHInstance()
   }
   return _unique_compo;
 }
+
+Engines::EngineComponent_var GetSMESHInstanceHasThis()
+{
+  return _unique_compo;
+}
index afd48fff99846f0eddef849adbce2329ef53a775..db796a531c0f62d8d8e5a528057ad42b44a2fd5a 100644 (file)
@@ -26,3 +26,4 @@
 #include CORBA_SERVER_HEADER(SMESH_Gen)
 
 SMESH_I_EXPORT Engines::EngineComponent_var RetrieveSMESHInstance();
+SMESH_I_EXPORT Engines::EngineComponent_var GetSMESHInstanceHasThis();