From 498e1712b4f1a11a3aa3c999b5af5b3eeed9f3d4 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Sat, 16 Jan 2021 05:58:47 +0100 Subject: [PATCH] First SMESH/GEOM case OK without external Server connection --- src/SMESH_I/CMakeLists.txt | 1 + src/SMESH_I/SMESH_Gen_i_1.cxx | 6 +++--- src/SMESH_SWIG/smeshBuilder.py | 11 +++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt index 1807b7dac..762f2d134 100644 --- a/src/SMESH_I/CMakeLists.txt +++ b/src/SMESH_I/CMakeLists.txt @@ -71,6 +71,7 @@ SET(_link_LIBRARIES ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeDS} + ${KERNEL_SalomeCatalog} ${OpenCASCADE_ApplicationFramework_LIBRARIES} ${OpenCASCADE_ModelingAlgorithms_LIBRARIES} ${GEOM_GEOMClient} diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index b7e042125..a2577de8b 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -41,7 +41,8 @@ #include #include #include "SALOMEDS_Study_i.hxx" -#include +#include "SALOME_KernelServices.hxx" +#include "SALOME_ModuleCatalog_impl.hxx" #include #include @@ -588,8 +589,7 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent() // If component for this SMESH engine does not exist in the study, create it - SALOME_ModuleCatalog::ModuleCatalog_var aCat = - SALOME_ModuleCatalog::ModuleCatalog::_narrow( GetNS()->Resolve("/Kernel/ModulCatalog") ); + SALOME_ModuleCatalog::ModuleCatalog_var aCat = KERNEL::getModuleComponentServantSA(); if ( CORBA::is_nil( aCat ) ) return father._retn(); diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 98c1f3e3b..d2f808840 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -620,7 +620,9 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ): obj = obj.GetMesh() elif isinstance( obj, Mesh_Algorithm ): obj = obj.GetAlgorithm() - ior = salome.orb.object_to_string(obj) + import CORBA + orb=CORBA.ORB_init(['']) + ior = orb.object_to_string(obj) SMESH._objref_SMESH_Gen.SetName(self, ior, name) def SetEmbeddedMode( self,theMode ): @@ -1962,9 +1964,10 @@ class Mesh(metaclass = MeshMeta): print(msg) print(allReasons) pass - if salome.sg.hasDesktop(): - if not isinstance( refresh, list): # not a call from subMesh.Compute() - if refresh: salome.sg.updateObjBrowser() + if salome.sg: + if salome.sg.hasDesktop(): + if not isinstance( refresh, list): # not a call from subMesh.Compute() + if refresh: salome.sg.updateObjBrowser() return ok -- 2.39.2