X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FKernelHelpers%2FSALOME_KernelServices.cxx;h=71f9456602d0cfa5e80b761f1f9f6c12d295a389;hb=2ea1a3f1f3622c6ad4c06d7d7e2a77db7b698489;hp=6e561397115d2d315b48502329816be023879199;hpb=f876c49e5d46d086f1d741abada5ae86494bb5bb;p=modules%2Fkernel.git diff --git a/src/KernelHelpers/SALOME_KernelServices.cxx b/src/KernelHelpers/SALOME_KernelServices.cxx index 6e5613971..71f945660 100644 --- a/src/KernelHelpers/SALOME_KernelServices.cxx +++ b/src/KernelHelpers/SALOME_KernelServices.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -61,18 +61,17 @@ namespace KERNEL { /** - * This returns a static reference to the SALOME study manager. The - * study manager can be used to retrieve a study or to get - * informations about a study. + * This returns a static reference to the SALOME study. The + * study can be used to get informations about it. */ - SALOMEDS::StudyManager_ptr getStudyManager() { - static SALOMEDS::StudyManager_ptr aStudyManager; - if(CORBA::is_nil(aStudyManager)){ + SALOMEDS::Study_ptr getStudyServant() { + static SALOMEDS::Study_ptr aStudy; + if(CORBA::is_nil(aStudy)){ SALOME_NamingService *aNamingService = getNamingService(); - CORBA::Object_ptr anObject = aNamingService->Resolve("/myStudyManager"); - aStudyManager = SALOMEDS::StudyManager::_narrow(anObject); + CORBA::Object_ptr anObject = aNamingService->Resolve("/Study"); + aStudy = SALOMEDS::Study::_narrow(anObject); } - return aStudyManager; + return aStudy; } /** @@ -117,27 +116,6 @@ namespace KERNEL { return resourcesManager; } - /** - * This returns the study with the specified id if it's defined in - * the SALOME study manager. Returns null otherwise. - * Please not that it is just a shortcut, and you may prefer use - * directly the study manager: - * KERNEL::getStudyManager()->GetStudyByID(aStudyId) - */ - SALOMEDS::Study_ptr getStudyById(int aStudyId) { - if ( aStudyId < 0 ) { - INFOS("ERR: trying to get a study with ID<0"); - return SALOMEDS::Study::_nil(); - } - return getStudyManager()->GetStudyByID(aStudyId); - } - - int getStudyId(SALOMEDS::Study_ptr study) { - if( CORBA::is_nil(study) ) return -1; - return study->StudyId(); - } - - /** * This function retrieve the CORBA object reference from the study * object wrapping it.