]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Move Python Study ref creation to KERNEL
authorAnthony Geay <anthony.geay@edf.fr>
Sat, 16 Jan 2021 06:37:03 +0000 (07:37 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Sat, 16 Jan 2021 06:37:03 +0000 (07:37 +0100)
src/GEOM_SWIG/GeomHelper.cxx
src/GEOM_SWIG/GeomHelper.h
src/GEOM_SWIG/GeomHelper.i
src/GEOM_SWIG/geomBuilder.py

index f971360be416531c1125ca9169a6de799932a126..ba89a1223f731913f5a394daa3956f833e0e5f89 100644 (file)
 #include "GEOM_Gen_i.hh"
 #include "SALOME_Container_i.hxx"
 #include "SALOME_KernelServices.hxx"
-#include "SALOMEDS_Study_i.hxx"
 
 #include <cstring>
 
-
 std::string BuildGEOMInstance()
 {
     CORBA::ORB_var orb;
@@ -56,11 +54,3 @@ std::string BuildGEOMInstance()
     CORBA::String_var ior = orb->object_to_string(zeRef);
     return std::string(ior.in());
 }
-
-std::string GetSessionInstance()
-{
-    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());
-}
index 0224e0c1fee7338c92f6951fdee3c74420c8867d..92676977c9375a3fa7d1228c3f5277a2a379faef 100644 (file)
@@ -19,5 +19,4 @@
 
 #include <string>
 
-std::string BuildGEOMInstance();
-std::string GetSessionInstance();
\ No newline at end of file
+std::string BuildGEOMInstance();
\ No newline at end of file
index 735be9c2da95b704478b287b819ff157db826c63..64d70cad9558997bedbb296750bae1d16c82f682 100644 (file)
 %inline
 {
   std::string BuildGEOMInstance();
-  std::string GetSessionInstance();
 }
-%pythoncode %{
-
-def myStudy():
-  import SALOMEDS
-  import CORBA
-  orb=CORBA.ORB_init([''])
-  return orb.string_to_object(GetSessionInstance())
-
-%}
\ No newline at end of file
index 0974aed9808e1ffcf13645b46e5c3664ef76abd2..a4c2d26fa0c290046b73eb88feb3de5d108098cc 100644 (file)
@@ -246,7 +246,7 @@ import omniORB
 # to avoid problems in some cases, e.g. when generating documentation
 try:
     import salome
-    #salome.salome_init()
+    salome.salome_init()
     from salome import *
 except:
     pass
@@ -705,13 +705,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
                         # 1. CORBA resolution of server
                         # 2. the __new__ method is called again
                         #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
-                        #geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
-                        import GeomHelper
-                        geom_ior = GeomHelper.BuildGEOMInstance()
-                        import GEOM
-                        import CORBA
-                        orb=CORBA.ORB_init([''])
-                        geom = orb.string_to_object(geom_ior)
+                        geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
                         #print "====1 ",geom
                 else:
                     # FindOrLoadComponent not called
@@ -837,8 +831,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
         ## @addtogroup l1_geomBuilder_auxiliary
         ## @{
         def init_geom(self):
-            import GeomHelper
-            self.myStudy = GeomHelper.myStudy()
+            self.myStudy = salome.myStudy
             self.myBuilder = self.myStudy.NewBuilder()
 
             # load data from the study file, if necessary