X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHClient%2FSMESH_Client.cxx;h=cd278ec4ccace400cf0429d14be279d908d4d784;hp=a1cee8e4e3a9cdb31030114d1c614a763dc69546;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=20248b6e76a67595f7f449a71ebbf18c13429389 diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index a1cee8e4e..cd278ec4c 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -24,8 +24,11 @@ // Module : SMESH #include "SMESH_Client.hxx" -#include "SMESH_Mesh.hxx" + +#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" @@ -54,7 +57,7 @@ #endif #ifdef _DEBUG_ -static int MYDEBUG = 1; +static int MYDEBUG = 0; #else static int MYDEBUG = 0; #endif @@ -743,9 +746,9 @@ namespace //======================================================================= //function : ChangePolyhedronNodes //======================================================================= - inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh, + inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + CORBA::Long theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long iind = 0, aNbElems = theSeq[theId].number; @@ -781,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; } @@ -815,22 +827,19 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB, mySMESHDSMesh(NULL), mySMDSMesh(NULL) { - MESSAGE("SMESH_Client::SMESH_Client"); + if ( MYDEBUG ) MESSAGE("SMESH_Client::SMESH_Client"); myMeshServer->Register(); CORBA::Boolean anIsEmbeddedMode; GetSMESHGen(theORB,anIsEmbeddedMode); if(anIsEmbeddedMode){ - if ( MYDEBUG ) - MESSAGE("Info: The same process, update mesh by pointer "); + if ( MYDEBUG ) MESSAGE("Info: The same process, update mesh by pointer "); // just set client mesh pointer to server mesh pointer //SMESH_Mesh* aMesh = reinterpret_cast(theMesh->GetMeshPtr()); CORBA::LongLong pointeur = theMesh->GetMeshPtr(); - if( MYDEBUG ) - MESSAGE("SMESH_Client::SMESH_Client pointeur "< (pointeur); - if ( MYDEBUG ) - MESSAGE("SMESH_Client::SMESH_Client aMesh "<GetMeshDS()->IsEmbeddedMode()){ if(anIsEmbeddedMode){ mySMESHDSMesh = aMesh->GetMeshDS(); @@ -886,20 +895,22 @@ bool SMESH_Client::Update(bool theIsClear) { bool anIsModified = true; - if(mySMESHDSMesh){ - MESSAGE("Update mySMESHDSMesh"); + if(mySMESHDSMesh) + { + if ( MYDEBUG ) MESSAGE("Update mySMESHDSMesh"); SMESHDS_Script* aScript = mySMESHDSMesh->GetScript(); anIsModified = aScript->IsModified(); aScript->SetModified(false); - }else{ - MESSAGE("Update CORBA"); + } + else + { + if ( MYDEBUG ) MESSAGE("Update CORBA"); SMESH::log_array_var aSeq = myMeshServer->GetLog( theIsClear ); CORBA::Long aLength = aSeq->length(); anIsModified = aLength > 0; - if( MYDEBUG ) - MESSAGE( "Update: length of the script is "<Renumber( anIndexes[i], anIndexes[i+1], anIndexes[i+2] ); - } + // for(CORBA::Long i=0; anElemId < aNbElems; anElemId++, i+=3) + // { + // mySMDSMesh->Renumber( anIndexes[i], anIndexes[i+1], anIndexes[i+2] ); + // } break; default:;