From: jfa Date: Mon, 13 Feb 2006 16:48:52 +0000 (+0000) Subject: Fix bug 11416: Post-Pro: Inherit VVTK_Viewer from SVTK_Viewer. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2bffa770732e633b93ff13a404b06a8382d769a9;p=modules%2Fgui.git Fix bug 11416: Post-Pro: Inherit VVTK_Viewer from SVTK_Viewer. --- diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index df8ae1474..03b8ca4a1 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -89,7 +89,7 @@ SVTK_Viewer for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){ if(TViewWindow* aView = dynamic_cast(aViewWindow)){ - aView->getMainWindow()->SetBackgroundColor(theColor); + aView->setBackgroundColor(theColor); } } } @@ -98,13 +98,13 @@ SVTK_Viewer } //========================================================== -SUIT_ViewWindow* +SUIT_ViewWindow* SVTK_Viewer:: createView( SUIT_Desktop* theDesktop ) { - SVTK_ViewWindow* aViewWindow = new SVTK_ViewWindow(theDesktop); + TViewWindow* aViewWindow = new TViewWindow(theDesktop); aViewWindow->Initialize(this); - + aViewWindow->setBackgroundColor( backgroundColor() ); aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() ); @@ -121,24 +121,18 @@ bool SVTK_Viewer::trihedronRelative() const return myTrihedronRelative; } -void SVTK_Viewer::setTrihedronSize( const int sz, const bool relative ) +void SVTK_Viewer::setTrihedronSize( const int theSize, const bool theRelative ) { - myTrihedronSize = sz; - myTrihedronRelative = relative; - - SUIT_ViewManager* vm = getViewManager(); - if ( !vm ) - return; - - QPtrVector vec = vm->getViews(); - for ( int i = 0; i < vec.count(); i++ ) - { - SUIT_ViewWindow* win = vec.at( i ); - if ( !win || !win->inherits( "SVTK_ViewWindow" ) ) - continue; - - SVTK_ViewWindow* vw = (SVTK_ViewWindow*)win; - vw->SetTrihedronSize( sz, relative ); + myTrihedronSize = theSize; + myTrihedronRelative = theRelative; + + if (SUIT_ViewManager* aViewManager = getViewManager()) { + QPtrVector aViews = aViewManager->getViews(); + for (int i = 0; i < aViews.count(); i++) { + if (TViewWindow* aView = dynamic_cast(aViews.at(i))) { + aView->SetTrihedronSize(theSize, theRelative); + } + } } } @@ -171,7 +165,7 @@ SVTK_Viewer thePopup->insertSeparator(); if(TViewWindow* aView = dynamic_cast(myViewManager->getActiveView())){ - if ( !aView->getView()->GetMainWindow()->getToolBar()->isVisible() ){ + if ( !aView->getMainWindow()->getToolBar()->isVisible() ){ thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) ); } } @@ -240,7 +234,7 @@ SVTK_Viewer QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ if(TViewWindow* aView = dynamic_cast(aViews.at(i))){ - aView->getView()->GetMainWindow()->getToolBar()->show(); + aView->getMainWindow()->getToolBar()->show(); } } } @@ -422,10 +416,11 @@ SVTK_Viewer { QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) - if(SVTK_View* aView = aViewWindow->getView()) - if(!aView->isVisible( io )) - return false; + if(SUIT_ViewWindow* aViewWindow = aViews.at(i)) + if(TViewWindow* aViewWnd = dynamic_cast(aViewWindow)) + if(SVTK_View* aView = aViewWnd->getView()) + if(!aView->isVisible( io )) + return false; return true; } @@ -438,7 +433,7 @@ SVTK_Viewer // if (theUpdateTrihedron) onAdjustTrihedron(); QPtrVector aViews = myViewManager->getViews(); for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) + if(TViewWindow* aViewWindow = dynamic_cast(aViews.at(i))) if(SVTK_View* aView = aViewWindow->getView()) aView->Repaint(); }