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}")
#include "GEOM_Gen_i.hh"
#include "SALOME_Container_i.hxx"
+#include "SALOME_KernelServices.hxx"
+#include "SALOMEDS_Study_i.hxx"
#include <cstring>
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
%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
## @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