From: stv Date: Fri, 8 Sep 2006 12:51:15 +0000 (+0000) Subject: Identificator assignment moved on the base level - SUIT_ViewManager. Useless id's... X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0570c948cee229af859823073be0eda47fcda64b;p=modules%2Fgui.git Identificator assignment moved on the base level - SUIT_ViewManager. Useless id's removed from inherit classes. Title mechanism in the SUIT_ViewManager was changed. Now view manager support title for views with specific tags: %M - view manager number, %V - view number. --- diff --git a/src/OCCViewer/OCCViewer_ViewManager.cxx b/src/OCCViewer/OCCViewer_ViewManager.cxx index 6436c81de..3d799109f 100755 --- a/src/OCCViewer/OCCViewer_ViewManager.cxx +++ b/src/OCCViewer/OCCViewer_ViewManager.cxx @@ -20,16 +20,13 @@ #include "OCCViewer_ViewWindow.h" #include "SUIT_Desktop.h" -int OCCViewer_ViewManager::myMaxId = 0; - /*! Constructor */ OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron ) -: SUIT_ViewManager( study, theDesktop ) +: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) ) { - myId = ++myMaxId; - setViewModel( new OCCViewer_Viewer( DisplayTrihedron ) ); + setTitle( tr( "OCC_VIEW_TITLE" ) ); } /*! @@ -39,16 +36,6 @@ OCCViewer_ViewManager::~OCCViewer_ViewManager() { } -/*! - Sets view name - \param theView - view to assign name -*/ -void OCCViewer_ViewManager::setViewName(SUIT_ViewWindow* theView) -{ - int aPos = myViews.find(theView); - theView->setCaption( tr( "OCC_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) ); -} - /*! Fills popup menu with custom actions \param popup - popup menu to be filled with diff --git a/src/OCCViewer/OCCViewer_ViewManager.h b/src/OCCViewer/OCCViewer_ViewManager.h index 352e873c5..ea88d3577 100755 --- a/src/OCCViewer/OCCViewer_ViewManager.h +++ b/src/OCCViewer/OCCViewer_ViewManager.h @@ -36,13 +36,6 @@ public: OCCViewer_Viewer* getOCCViewer() { return (OCCViewer_Viewer*) myViewModel; } virtual void contextMenuPopup( QPopupMenu* ); - -protected: - void setViewName(SUIT_ViewWindow* theView); - -protected: - static int myMaxId; - int myId; }; #endif diff --git a/src/Plot2d/Plot2d_ViewManager.cxx b/src/Plot2d/Plot2d_ViewManager.cxx index 405e90243..7681bd3f2 100755 --- a/src/Plot2d/Plot2d_ViewManager.cxx +++ b/src/Plot2d/Plot2d_ViewManager.cxx @@ -20,17 +20,13 @@ #include "Plot2d_ViewModel.h" #include "Plot2d_ViewWindow.h" -int Plot2d_ViewManager::myMaxId = 0; - /*! Constructor */ Plot2d_ViewManager::Plot2d_ViewManager( SUIT_Study* study, SUIT_Desktop* desk ) -: SUIT_ViewManager( study, desk ) +: SUIT_ViewManager( study, desk, new Plot2d_Viewer() ) { - myId = ++myMaxId; - Plot2d_Viewer* v = new Plot2d_Viewer(); - setViewModel( v ); + setTitle( tr( "PLOT2D_VIEW_TITLE" ) ); } /*! @@ -48,16 +44,6 @@ Plot2d_Viewer* Plot2d_ViewManager::getPlot2dModel() const return (Plot2d_Viewer*)myViewModel; } -/*! - Sets default name of view - \param the View - view to be renamed -*/ -void Plot2d_ViewManager::setViewName( SUIT_ViewWindow* theView ) -{ - int aPos = myViews.find(theView); - theView->setCaption( QString( "Plot2d scene:%1 - viewer:%2" ).arg(myId).arg(aPos+1)); -} - /*! Adds new view \param theView - view to be added diff --git a/src/Plot2d/Plot2d_ViewManager.h b/src/Plot2d/Plot2d_ViewManager.h index 051b26f19..a26b01cb6 100755 --- a/src/Plot2d/Plot2d_ViewManager.h +++ b/src/Plot2d/Plot2d_ViewManager.h @@ -37,7 +37,6 @@ public: Plot2d_Viewer* getPlot2dModel() const; protected: - void setViewName(SUIT_ViewWindow* theView); bool insertView(SUIT_ViewWindow* theView); public slots: @@ -48,10 +47,6 @@ protected slots: signals: void cloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* ); - -protected: - static int myMaxId; - int myId; }; #endif diff --git a/src/SVTK/SVTK_ViewManager.cxx b/src/SVTK/SVTK_ViewManager.cxx index 3465d1535..b7856fdc7 100644 --- a/src/SVTK/SVTK_ViewManager.cxx +++ b/src/SVTK/SVTK_ViewManager.cxx @@ -19,17 +19,15 @@ #include "SVTK_ViewManager.h" #include "SVTK_ViewModel.h" -int SVTK_ViewManager::_SVTKViewMgr_Id = 0; +#include /*! Constructor */ -SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, - SUIT_Desktop* theDesktop ) -: SUIT_ViewManager( study, theDesktop ) +SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) +: SUIT_ViewManager( study, theDesktop, new SVTK_Viewer() ) { - myId = ++_SVTKViewMgr_Id; - setViewModel( new SVTK_Viewer() ); + setTitle( VTKViewer_ViewManager::tr( "VTK_VIEW_TITLE" ) ); } /*! @@ -46,12 +44,3 @@ SUIT_Desktop* SVTK_ViewManager::getDesktop() { return myDesktop; } - -/*! - Sets default name of view -*/ -void SVTK_ViewManager::setViewName(SUIT_ViewWindow* theView) -{ - int aPos = myViews.find(theView); - theView->setCaption( tr( "VTK_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) ); -} diff --git a/src/SVTK/SVTK_ViewManager.h b/src/SVTK/SVTK_ViewManager.h index eda062600..8ff4efcc9 100644 --- a/src/SVTK/SVTK_ViewManager.h +++ b/src/SVTK/SVTK_ViewManager.h @@ -37,13 +37,6 @@ public: virtual ~SVTK_ViewManager(); SUIT_Desktop* getDesktop(); - -protected: - void setViewName( SUIT_ViewWindow* theView ); - -private: - int myId; - static int _SVTKViewMgr_Id; }; #endif diff --git a/src/VTKViewer/VTKViewer_ViewManager.cxx b/src/VTKViewer/VTKViewer_ViewManager.cxx index d67c92d1e..a206be6ee 100755 --- a/src/VTKViewer/VTKViewer_ViewManager.cxx +++ b/src/VTKViewer/VTKViewer_ViewManager.cxx @@ -19,16 +19,13 @@ #include "VTKViewer_ViewManager.h" #include "VTKViewer_ViewModel.h" -int VTKViewer_ViewManager::_VTKViewMgr_Id = 0; - /*!Constructor.Initialize SIUT_ViewManager by \a study and \a theDesktop. * Create new instance of VTKViewer_Viewer and set view model by it. */ VTKViewer_ViewManager::VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) -: SUIT_ViewManager( study, theDesktop ) +: SUIT_ViewManager( study, theDesktop, new VTKViewer_Viewer() ) { - myId = ++_VTKViewMgr_Id; - setViewModel( new VTKViewer_Viewer() ); + setTitle( tr( "VTK_VIEW_TITLE" ) ); } /*!Destructor.*/ @@ -36,10 +33,3 @@ VTKViewer_ViewManager::~VTKViewer_ViewManager() { /*!Do nothing.*/ } - -/*!Sets view window name*/ -void VTKViewer_ViewManager::setViewName(SUIT_ViewWindow* theView) -{ - int aPos = myViews.find(theView); - theView->setCaption( tr( "VTK_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) ); -} diff --git a/src/VTKViewer/VTKViewer_ViewManager.h b/src/VTKViewer/VTKViewer_ViewManager.h index 49d9a26c8..38518fe06 100755 --- a/src/VTKViewer/VTKViewer_ViewManager.h +++ b/src/VTKViewer/VTKViewer_ViewManager.h @@ -33,13 +33,6 @@ class VTKVIEWER_EXPORT VTKViewer_ViewManager : public SUIT_ViewManager public: VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* ); virtual ~VTKViewer_ViewManager(); - -protected: - void setViewName( SUIT_ViewWindow* theView ); - -private: - int myId; - static int _VTKViewMgr_Id; }; #endif