]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Replaced a usage of SALOMEDS objects with calls to SALOMEDSClient wrappers
authorsrn <srn@opencascade.com>
Mon, 20 Feb 2006 11:28:07 +0000 (11:28 +0000)
committersrn <srn@opencascade.com>
Mon, 20 Feb 2006 11:28:07 +0000 (11:28 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_TypeFilter.cxx
src/Session/Session_ServerThread.cxx

index 5139ce4f2a74240ae1f3fafdd2d405a940225e9b..afe4b2b8737371050e588ad9198c35dcb883e2d7 100644 (file)
 #include <qlistbox.h>
 #include <qregexp.h>
 
-#include "SALOMEDS_StudyManager.hxx"
-#include "SALOMEDS_SObject.hxx"
-
 #include "SALOME_ListIteratorOfListIO.hxx"
 #include "SALOME_ListIO.hxx"
 
 #include "ToolsGUI_CatalogGeneratorDlg.h"
 #include "ToolsGUI_RegWidget.h"
 
+#include <SALOMEDSClient_ClientFactory.hxx>
+
 /*!Create new instance of SalomeApp_Application.*/
 extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
 {
@@ -362,12 +361,8 @@ void SalomeApp_Application::onSelectionChanged()
          _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
 
          if ( so ) {
-           SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(so.get());
-
-           if ( aSO ) {
-             canCopy = studyMgr()->CanCopy(so);
-             canPaste = studyMgr()->CanPaste(so);
-           }
+          canCopy = studyMgr()->CanCopy(so);
+          canPaste = studyMgr()->CanPaste(so);
          }
        }
      }
@@ -630,8 +625,9 @@ CORBA::ORB_var SalomeApp_Application::orb()
 /*!Create and return SALOMEDS_StudyManager.*/
 SALOMEDSClient_StudyManager* SalomeApp_Application::studyMgr()
 {
-  static SALOMEDSClient_StudyManager* _sm = new SALOMEDS_StudyManager();
-  return _sm;
+  static _PTR(StudyManager) _sm;
+  if(!_sm) _sm = ClientFactory::StudyManager();
+  return _sm.get();
 }
 
 /*!Create and return SALOME_NamingService.*/
index 58ab6bb57317f4031e85a00f752b6d61748b0a24..5cedb609cf37894f70a1930b0347ba1de77c78ea 100644 (file)
@@ -21,8 +21,6 @@
 #include "LightApp_DataOwner.h"
 #include "SalomeApp_Study.h"
 
-#include <SALOMEDS_SObject.hxx>
-
 /*!
   Constructor.
 */
index 7e3714518365081811f7215aa8e1c70099fa7267..a0d00d9eab551d73642e937a7c77288399534000 100755 (executable)
@@ -34,7 +34,8 @@
 
 #include "SALOME_Container_i.hxx"
 #include "SALOME_ContainerManager.hxx"
-#include "SALOMEDS_StudyManager_i.hxx"
+#include <SALOMEDSClient.hxx>
+#include <SALOMEDSClient_ClientFactory.hxx>
 #include "SALOME_ModuleCatalog_impl.hxx"
 #include "RegistryService.hxx"
 #include "Session_Session_i.hxx"
@@ -246,15 +247,7 @@ void Session_ServerThread::ActivateSALOMEDS(int argc,
       // counted objects, they will be deleted by the POA when they are no
       // longer needed.    
 
-      SALOMEDS_StudyManager_i * myStudyManager_i
-       = new  SALOMEDS_StudyManager_i(_orb,_root_poa);
-      
-      // Activate the objects.  This tells the POA that the objects are
-      // ready to accept requests.
-
-      PortableServer::ObjectId_var myStudyManager_iid
-       = _root_poa->activate_object(myStudyManager_i);
-      myStudyManager_i->register_name("/myStudyManager");
+      ClientFactory::createStudyManager(_orb,_root_poa);
     }
   catch(CORBA::SystemException&)
     {