#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;
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());
-}
#include <string>
-std::string BuildGEOMInstance();
-std::string GetSessionInstance();
\ No newline at end of file
+std::string BuildGEOMInstance();
\ No newline at end of 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
# 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
# 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
## @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