mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-26 09:20:35 +05:00
TODO : Move myStudy from GEOM to KERNEL
This commit is contained in:
parent
01b0ad6701
commit
294f92ee45
@ -141,7 +141,7 @@ IF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
|
||||
ELSE()
|
||||
SWIG_ADD_LIBRARY(GeomHelper LANGUAGE python SOURCES ${GeomHelper_SOURCES})
|
||||
ENDIF()
|
||||
SWIG_LINK_LIBRARIES(GeomHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} GEOMEngine )
|
||||
SWIG_LINK_LIBRARIES(GeomHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} GEOMEngine ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeDS} )
|
||||
install(TARGETS _GeomHelper DESTINATION ${SALOME_INSTALL_LIBS})
|
||||
install(FILES ${GeomHelper_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
|
||||
SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_GeomHelper_REAL_NAME}")
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#include "GEOM_Gen_i.hh"
|
||||
#include "SALOME_Container_i.hxx"
|
||||
#include "SALOME_KernelServices.hxx"
|
||||
#include "SALOMEDS_Study_i.hxx"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@ -50,3 +52,11 @@ 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());
|
||||
}
|
||||
|
@ -20,3 +20,4 @@
|
||||
#include <string>
|
||||
|
||||
std::string BuildGEOMInstance();
|
||||
std::string GetSessionInstance();
|
@ -24,4 +24,14 @@
|
||||
%inline
|
||||
{
|
||||
std::string BuildGEOMInstance();
|
||||
std::string GetSessionInstance();
|
||||
}
|
||||
%pythoncode %{
|
||||
|
||||
def myStudy():
|
||||
import SALOMEDS
|
||||
import CORBA
|
||||
orb=CORBA.ORB_init([''])
|
||||
return orb.string_to_object(GetSessionInstance())
|
||||
|
||||
%}
|
@ -837,7 +837,8 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
|
||||
## @addtogroup l1_geomBuilder_auxiliary
|
||||
## @{
|
||||
def init_geom(self):
|
||||
self.myStudy = salome.myStudy
|
||||
import GeomHelper
|
||||
self.myStudy = GeomHelper.myStudy()
|
||||
self.myBuilder = self.myStudy.NewBuilder()
|
||||
|
||||
# load data from the study file, if necessary
|
||||
|
Loading…
Reference in New Issue
Block a user