From 67e17c78dcb1b059f33e1f7b2d878bf8754d8770 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 12 Jan 2021 17:31:25 +0100 Subject: [PATCH] WIP --- src/SMESH_SWIG/SMeshHelper.cxx | 2 +- src/SMESH_SWIG/smeshBuilder.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SMESH_SWIG/SMeshHelper.cxx b/src/SMESH_SWIG/SMeshHelper.cxx index 5004b6635..9ed1d558c 100644 --- a/src/SMESH_SWIG/SMeshHelper.cxx +++ b/src/SMESH_SWIG/SMeshHelper.cxx @@ -24,10 +24,10 @@ #include -CORBA::ORB_var orb; std::string BuildSMESHInstance() { + CORBA::ORB_var orb; { int argc(0); orb = CORBA::ORB_init(argc,nullptr); } CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index c99e95821..a87ba0cd7 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -380,7 +380,13 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ): # 1. CORBA resolution of server # 2. the __new__ method is called again #print("==== smeshInst = lcc.FindOrLoadComponent ", engine, smeshInst, doLcc) - smeshInst = salome.lcc.FindOrLoadComponent( "FactoryServer", "SMESH" ) + #smeshInst = salome.lcc.FindOrLoadComponent( "FactoryServer", "SMESH" ) + import SMeshHelper + smesh_ior = SMeshHelper.BuildSMESHInstance() + import SMESH + import CORBA + orb=CORBA.ORB_init(['']) + smeshInst = orb.string_to_object(smesh_ior) else: # FindOrLoadComponent not called if smeshInst is None: -- 2.39.2