From 76da6e38597563957f22bdf5012ddfb20c03a351 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Sat, 16 Jan 2021 07:36:22 +0100 Subject: [PATCH] Move Python Study ref creation to KERNEL --- src/SMESH_SWIG/SMeshHelper.cxx | 10 ---------- src/SMESH_SWIG/SMeshHelper.h | 1 - src/SMESH_SWIG/SMeshHelper.i | 15 --------------- 3 files changed, 26 deletions(-) diff --git a/src/SMESH_SWIG/SMeshHelper.cxx b/src/SMESH_SWIG/SMeshHelper.cxx index 4b7b2b275..78f24d2d1 100644 --- a/src/SMESH_SWIG/SMeshHelper.cxx +++ b/src/SMESH_SWIG/SMeshHelper.cxx @@ -22,11 +22,9 @@ #include "SMESH_Gen_i.hxx" #include "SALOME_Container_i.hxx" #include "SALOME_KernelServices.hxx" -#include "SALOMEDS_Study_i.hxx" #include - std::string BuildSMESHInstanceInternal(bool checkNS) { CORBA::ORB_var orb; @@ -50,11 +48,3 @@ std::string BuildSMESHInstanceInternal(bool checkNS) CORBA::String_var ior = orb->object_to_string(zeRef); return std::string(ior.in()); } - -std::string GetSessionInstanceInternal() -{ - SALOMEDS::Study_var study = KERNEL::getStudyServantSA(); - CORBA::ORB_ptr orb = KERNEL::getORB(); - CORBA::String_var ior = orb->object_to_string(study); - return std::string(ior.in()); -} diff --git a/src/SMESH_SWIG/SMeshHelper.h b/src/SMESH_SWIG/SMeshHelper.h index dd3d5dabe..bef5532ca 100644 --- a/src/SMESH_SWIG/SMeshHelper.h +++ b/src/SMESH_SWIG/SMeshHelper.h @@ -22,4 +22,3 @@ #include std::string BuildSMESHInstanceInternal(bool checkNS); -std::string GetSessionInstanceInternal(); diff --git a/src/SMESH_SWIG/SMeshHelper.i b/src/SMESH_SWIG/SMeshHelper.i index 63b7c7e77..8745d96e0 100644 --- a/src/SMESH_SWIG/SMeshHelper.i +++ b/src/SMESH_SWIG/SMeshHelper.i @@ -31,19 +31,4 @@ { return BuildSMESHInstanceInternal(checkNS); } - - std::string GetSessionInstance() - { - return GetSessionInstanceInternal(); - } } - -%pythoncode %{ - -def myStudy(): - import SALOMEDS - import CORBA - orb=CORBA.ORB_init(['']) - return orb.string_to_object(GetSessionInstance()) - -%} \ No newline at end of file -- 2.39.2