From: imn Date: Fri, 14 Oct 2016 14:07:44 +0000 (+0300) Subject: 0023299: [CEA] Finalize multi-study removal X-Git-Tag: V9_0_0~2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=41bd58dadb57aa8bdcf0d9c689a8e3bc8541afd7;p=modules%2Fhexablock.git 0023299: [CEA] Finalize multi-study removal - delete study id parameter --- diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index cff4a46..89a4f09 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -127,8 +127,6 @@ using namespace std; using namespace HEXABLOCK::GUI; -int HEXABLOCKGUI::_oldStudyId = -1; - // HEXABLOCK_ORB::HEXABLOCK_Gen_var HEXABLOCKGUI::_hexaEngine = HEXABLOCK_ORB::HEXABLOCK_Gen::_nil(); // VtkDocumentGraphicView* HEXABLOCKGUI::currentDocGView = NULL; @@ -252,7 +250,6 @@ void HEXABLOCKGUI::initialize( CAM_Application* app ) createActions(); createMenus(); createTools(); - studyActivated(); } void HEXABLOCKGUI::viewManagers( QStringList& list ) const @@ -421,13 +418,11 @@ bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy ) return bOk; } -SALOMEDS::Study_var HEXABLOCKGUI::ClientStudyToStudy (_PTR(Study) theStudy) +SALOMEDS::Study_var HEXABLOCKGUI::ClientStudy() { SALOME_NamingService *aNamingService = SalomeApp_Application::namingService(); - CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject); - int aStudyID = theStudy->StudyId(); - SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(aStudyID); + CORBA::Object_var aSMObject = aNamingService->Resolve("/Study"); + SALOMEDS::Study_var aDSStudy = SALOMEDS::Study::_narrow(aSMObject); return aDSStudy._retn(); } @@ -440,8 +435,7 @@ void HEXABLOCKGUI::addInStudy(QMap& topo_shapes, SalomeApp_Study* appStudy = HEXABLOCKGUI::activeStudy(); if(!appStudy) return; - _PTR(Study) aStudy = appStudy->studyDS(); - SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( aStudy ); + SALOMEDS::Study_var aDSStudy = ClientStudy(); SALOMEDS::StudyBuilder_var aBuilder (aDSStudy->NewBuilder()); QString entry = currentDocGView->getDocumentModel()->documentEntry(); SALOMEDS::SObject_var aFatherSO = aDSStudy->FindObjectID( qPrintable(entry) ); @@ -875,26 +869,6 @@ void HEXABLOCKGUI::preferencesChanged( const QString& sect, const QString& name // _genericGui->getCatalogWidget()->addCatalogFromFile(Resource::userCatalog.toStdString()); } -void HEXABLOCKGUI::studyActivated() //CS_TODO -{ - int newStudyId = getApp()->activeStudy()->id(); - DEBTRACE("HEXABLOCKGUI::studyActivated " << _oldStudyId << " " << newStudyId); -// if (_oldStudyId != -1) -// { -// _studyContextMap[_oldStudyId] = QtGuiContext::getQtCurrent(); -// if (_studyContextMap.count(newStudyId)) -// { -// DEBTRACE("switch to valid context " << QtGuiContext::getQtCurrent() << " " << _studyContextMap[newStudyId]); -// QtGuiContext::setQtCurrent(_studyContextMap[newStudyId]); -// } -// else -// { -// DEBTRACE("no switch to null context"); -// } -// } - _oldStudyId = newStudyId; -} - void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition) { QModelIndex currentIndex = _patternDataTreeView->currentIndex(); @@ -3239,8 +3213,7 @@ QString HEXABLOCKGUI::addDocInStudy (HEXA_NS::Document* document) if (app_study == NULL) return docEntry; - _PTR(Study) study = app_study->studyDS(); - SALOMEDS::Study_var ds_study = ClientStudyToStudy (study); + SALOMEDS::Study_var ds_study = ClientStudy(); SALOMEDS::StudyBuilder_var aBuilder (ds_study->NewBuilder()); QString entry = app_study->centry("HEXABLOCK"); SALOMEDS::SObject_var aFatherSO = ds_study->FindObjectID( qPrintable(entry) ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx index 9b88c6a..c7efb37 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx @@ -136,7 +136,7 @@ public: // static HEXABLOCK_ORB::HEXABLOCK_Gen_ptr InitHEXABLOCKGen( SalomeApp_Application* ); static LightApp_SelectionMgr* selectionMgr(); - static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy); + static SALOMEDS::Study_var ClientStudy(); static ViewType getActiveViewType(); static HEXABLOCKGUI* getInstance(); @@ -161,7 +161,6 @@ public: virtual void setResource(SUIT_ResourceMgr* r); virtual void createPreferences(); virtual void preferencesChanged( const QString& sect, const QString& name ); - virtual void studyActivated(); ///Returns a new HEXA_NS::Document and it's entry in the study std::pair newHexaDocument(); @@ -247,7 +246,6 @@ protected: HEXABLOCK::GUI::VtkDocumentGraphicView* lastVtkDocGView; HEXABLOCKGUI_Resource* _myresource; - static int _oldStudyId; // static HEXABLOCK_ORB::HEXABLOCK_Gen_var _hexaEngine; // Hexa6 TODo private slots: