From: vsv Date: Fri, 25 Jul 2008 07:38:40 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: TG_VISU_2008_2008-08-22~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4abb5970db39c0508f72734250f1563049b4591d;p=modules%2Fgui.git *** empty log message *** --- diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index b8ed8afdf..df358c9e6 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -37,7 +37,6 @@ class SUIT_Application; class CAM_Study; class CAM_DataModel; class CAM_Application; -class CAM_ViewExtender; #ifdef WIN32 #pragma warning( disable: 4251 ) @@ -77,9 +76,6 @@ public: void setToolShown( QAction*, const bool ); void setToolShown( const int, const bool ); - //! Returns Module dedicated extension for Viewer. Returns 0 if module has no extension - virtual CAM_ViewExtender* getViewExtender() { return 0; } - public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); diff --git a/src/CAM/CAM_ViewExtender.h b/src/CAM/CAM_ViewExtender.h deleted file mode 100644 index 60ec81b68..000000000 --- a/src/CAM/CAM_ViewExtender.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef CAM_VIEWEXTENDER_H -#define CAM_VIEWEXTENDER_H - -#include "CAM.h" - -class QtxActionToolMgr; -class QMenu; -class SUIT_ViewModel; -class SUIT_ViewWindow; -/*! - An interface which can be used as a module dedicated extension for Viewer -*/ -class CAM_EXPORT CAM_ViewExtender -{ -public: - //! Creates a New toolbar containing extending actions. Returns New Toolbar Id - virtual int createToolbar(SUIT_ViewWindow* ) = 0; - virtual void contextMenuPopup(QMenu* ) = 0; - virtual void activate(SUIT_ViewModel*) = 0; - virtual void deactivate(SUIT_ViewModel*) = 0; -}; - -#endif diff --git a/src/CAM/Makefile.am b/src/CAM/Makefile.am index 552e4abc8..8f96c76ca 100755 --- a/src/CAM/Makefile.am +++ b/src/CAM/Makefile.am @@ -31,8 +31,7 @@ salomeinclude_HEADERS= \ CAM_DataModel.h \ CAM_DataObject.h \ CAM_Module.h \ - CAM_Study.h \ - CAM_ViewExtender.h + CAM_Study.h dist_libCAM_la_SOURCES= \ CAM_Application.cxx \ diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 37276950e..f35b87fd8 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1305,7 +1305,6 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType resMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", vm->spacemouseBtn(2) ), resMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", vm->spacemouseBtn(3) ) ); new LightApp_VTKSelector( vm, mySelMgr ); - vm->connectToApplication(this); } #else viewMgr = new VTKViewer_ViewManager( activeStudy(), desktop() ); @@ -2766,7 +2765,6 @@ bool LightApp_Application::activateModule( CAM_Module* mod ) if ( objectBrowser() ) objectBrowser()->updateTree(); - //emit moduleActivated(mod); return res; } diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 7a4a04940..954d39f8b 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -36,15 +36,11 @@ #include "SUIT_ViewModel.h" #include "SUIT_ViewManager.h" -#include "CAM_Module.h" -#include "CAM_Application.h" #include #include -#include - // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study. // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from // SALOMEDS::StudyManager - no linkage with SalomeApp. @@ -72,7 +68,6 @@ */ SVTK_Viewer::SVTK_Viewer() { - myActiveModule = 0; myTrihedronSize = 105; myTrihedronRelative = true; myIncrementSpeed = 10; @@ -140,13 +135,6 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop ) connect(aViewWindow, SIGNAL( actorRemoved(VTKViewer_Actor*) ), this, SLOT(onActorRemoved(VTKViewer_Actor*))); - if (myActiveModule) { - CAM_ViewExtender* aExtender = myActiveModule->getViewExtender(); - if (aExtender) { - QtxActionToolMgr* aMgr = aViewWindow->toolMgr(); - myExtToolBarId = aExtender->createToolbar(aViewWindow); - } - } return aViewWindow; } @@ -348,12 +336,6 @@ void SVTK_Viewer::contextMenuPopup( QMenu* thePopup ) thePopup->addAction( (*it)->toggleViewAction() ); aView->RefreshDumpImage(); } - if (myActiveModule) { - CAM_ViewExtender* aExtender = myActiveModule->getViewExtender(); - if (aExtender) { - aExtender->contextMenuPopup(thePopup); - } - } } /*! @@ -620,54 +602,6 @@ void SVTK_Viewer::Repaint() aView->Repaint(); } -void SVTK_Viewer::connectToApplication( CAM_Application* theApp ) -{ - onModuleActivated(theApp->activeModule()); - connect(theApp, SIGNAL(moduleActivated(CAM_Module*)), - this, SLOT(onModuleActivated(CAM_Module*))); -} - - -void SVTK_Viewer::onModuleActivated( CAM_Module* mod ) -{ - CAM_Module* aModule = dynamic_cast(mod); - if (aModule) { - if (myActiveModule != aModule) { - CAM_ViewExtender* aExtender = (myActiveModule)? myActiveModule->getViewExtender() : 0; - if (aExtender) - aExtender->deactivate(this); - - myActiveModule = aModule; - aExtender = myActiveModule->getViewExtender(); - if (aExtender) - aExtender->activate(this); - - updateToolBars(); - } - } -} - - -void SVTK_Viewer::updateToolBars() -{ - if (!myActiveModule) return; - - CAM_ViewExtender* aExtender = myActiveModule->getViewExtender(); - int aNewId = -1; - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) { - if(SUIT_ViewWindow* aViewWindow = aViews.at(i)) { - if(TViewWindow* aViewWnd = dynamic_cast(aViewWindow)) { - QtxActionToolMgr* aMgr = aViewWnd->toolMgr(); - if (myExtToolBarId != -1) - aMgr->removeToolBar(myExtToolBarId); - if (aExtender) - aNewId = aExtender->createToolbar(aViewWnd); - } - } - } - myExtToolBarId = aNewId; -} void SVTK_Viewer::onActorAdded(VTKViewer_Actor* theActor) { diff --git a/src/SVTK/SVTK_ViewModel.h b/src/SVTK/SVTK_ViewModel.h index d09391c5a..e37d32401 100644 --- a/src/SVTK/SVTK_ViewModel.h +++ b/src/SVTK/SVTK_ViewModel.h @@ -31,9 +31,6 @@ class QMouseEvent; class SVTK_ViewWindow; -class CAM_Module; -class CAM_Application; -class CAM_Module; class VTKViewer_Actor; //! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View @@ -139,9 +136,6 @@ public: //! See #SALOME_View::Repaint() virtual void Repaint(); - - virtual void connectToApplication(CAM_Application* theApp); - signals: void actorAdded(SVTK_ViewWindow*, VTKViewer_Actor*); void actorRemoved(SVTK_ViewWindow*, VTKViewer_Actor*); @@ -154,7 +148,6 @@ protected slots: void onDumpView(); void onChangeBgColor(); - void onModuleActivated( CAM_Module* mod ); void onActorAdded(VTKViewer_Actor*); void onActorRemoved(VTKViewer_Actor*); @@ -172,9 +165,6 @@ private: int myProjMode; int myStyle; int mySpaceBtn[3]; - - CAM_Module* myActiveModule; - int myExtToolBarId; }; #endif