From 0460598777c942a1fefbefbae8243843e38eadd4 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 15 Dec 2016 17:26:42 +0300 Subject: [PATCH] Issue #1895: We can not create Shaper selector when Shaper module is not active because it switched OFF all other selectors --- src/SHAPERGUI/SHAPERGUI.cpp | 39 ++++++++++++++++++++----------------- src/SHAPERGUI/SHAPERGUI.h | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index bea2a1fad..4e3534e83 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -144,24 +144,27 @@ void SHAPERGUI::viewManagers(QStringList& theList) const } //****************************************************** -void SHAPERGUI::connectToStudy(CAM_Study* theStudy) -{ - // if there are created viewer managers, we should try to create viewer - // selector and initialize viewer with it. It sets interactive contect to the - // proxy viewer. If study is opened, CAM application calls this method before the open() - // of data model - // the SHAPER data model is specific and during open(load) redisplay signals are flushed, so - // we need to connect to the viewer before it. Here, it seems the most appropriate place for this - // according to SALOME architecture. - if (!mySelector) { - ViewManagerList OCCViewManagers; - application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers); - if (OCCViewManagers.size() > 0) { - mySelector = createSelector(OCCViewManagers.first()); - } - } - LightApp_Module::connectToStudy(theStudy); -} +// We can not create selector in this method because it can be called when +// SHAPER module is not active. Take into account that creation of our selector +// leads to switching OFF all other selectors +//void SHAPERGUI::connectToStudy(CAM_Study* theStudy) +//{ +// // if there are created viewer managers, we should try to create viewer +// // selector and initialize viewer with it. It sets interactive contect to the +// // proxy viewer. If study is opened, CAM application calls this method before the open() +// // of data model +// // the SHAPER data model is specific and during open(load) redisplay signals are flushed, so +// // we need to connect to the viewer before it. Here, it seems the most appropriate place for this +// // according to SALOME architecture. +// if (!mySelector) { +// ViewManagerList OCCViewManagers; +// application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers); +// if (OCCViewManagers.size() > 0) { +// mySelector = createSelector(OCCViewManagers.first()); +// } +// } +// LightApp_Module::connectToStudy(theStudy); +//} //****************************************************** bool SHAPERGUI::activateModule(SUIT_Study* theStudy) diff --git a/src/SHAPERGUI/SHAPERGUI.h b/src/SHAPERGUI/SHAPERGUI.h index b940d8a19..9b9f28aab 100644 --- a/src/SHAPERGUI/SHAPERGUI.h +++ b/src/SHAPERGUI/SHAPERGUI.h @@ -143,7 +143,7 @@ Q_OBJECT /// \brief The method is redefined to connect to the study viewer before the data /// model is filled by opened file. This file open will flush redisplay signals for, /// objects which should be visualized - virtual void connectToStudy(CAM_Study* theStudy); + //virtual void connectToStudy(CAM_Study* theStudy); /// \brief The method is called on the module activation /// \param theStudy current study -- 2.39.2