From 4365c62f52a4c0ff0afe47478f7d0d43642779c1 Mon Sep 17 00:00:00 2001 From: asv Date: Fri, 17 Feb 2006 10:55:13 +0000 Subject: [PATCH] activating saved viewer is done. --- src/VISUGUI/VisuGUI.cxx | 13 ++++++++++++- src/VISUGUI/VisuGUI_Module.cxx | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 7bc17315..11b4a3fd 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -142,6 +142,9 @@ #include "VisuGUI_Timer.h" +#include "VVTK_ViewModel.h" + + using namespace VISU; #ifdef _DEBUG_ @@ -2705,7 +2708,15 @@ VisuGUI:: viewManagers( QStringList& theList ) const { theList.clear(); - theList.append( SVTK_Viewer::Type() ); + // append SVTK viewer only if there is neither SVTK nor VVTK is open + QPtrList lst; + getApp()->viewManagers( SVTK_Viewer::Type(), lst ); + if ( !lst.count() ) { + lst.clear(); + getApp()->viewManagers( VVTK_Viewer::Type(), lst ); + if ( !lst.count() ) + theList.append( SVTK_Viewer::Type() ); + } } diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 53938c06..e73dc8eb 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1629,6 +1629,14 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) } } + // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual + // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open.. + /* + lst.clear(); + getApp()->viewManagers( SVTK_Viewer::Type(), lst ); + ip.setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() ); + */ + // main cycle to store parameters of displayed objects lst.clear(); getApp()->viewManagers( lst ); @@ -1972,6 +1980,20 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) } } // ] end of update views + // VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual + // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we close one + // default SVTK if needed. + /* + QString openedSvtkViewerStr = ip.getProperty( "VtkViewersCount" ).c_str(); + int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok ); + if ( ok && openedSvtkViewer == 0 ) { + lst.clear(); + getApp()->viewManagers( SVTK_Viewer::Type(), lst ); + if ( lst.count() ) + lst.at( 0 )->closeAllViews(); + } + */ + // if active Gauss Viewer is set ( != -1) then raise the gauss view window. bool ok; QString activeGaussViewerStr = ip.getProperty( "ActiveGaussViewer" ).c_str(); -- 2.39.2