Back to index

salome-paravis  6.5.0
PVGUI_ViewWindow.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 // File   : PVGUI_ViewWindow.cxx
00020 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00021 //
00022 
00023 #include "PVGUI_ViewWindow.h"
00024 
00025 #include <SUIT_ViewManager.h>
00026 #include <SUIT_ResourceMgr.h>
00027 #include <SUIT_Session.h>
00028 #include <SUIT_Desktop.h>
00029 
00030 #include <pqTabbedMultiViewWidget.h>
00031 #include <pqApplicationCore.h>
00032 
00043 PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theModel )
00044   : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 )
00045 {
00046   myModel = theModel;
00047   myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
00048   if (myPVMgr) {
00049     myPVMgr->setParent( this );
00050     // This is mandatory, see setParent() method in Qt 4 documentation
00051     myPVMgr->show();
00052     setCentralWidget( myPVMgr );
00053   } else
00054     qDebug("No multiViewManager defined");
00055 }
00056 
00063 PVGUI_ViewWindow::~PVGUI_ViewWindow()
00064 {
00065   if ( myPVMgr ) {
00066     myPVMgr->setParent( 0 );
00067     myPVMgr->hide();
00068     myPVMgr = 0;
00069     setCentralWidget( 0 );
00070   }
00071 }
00072 
00077 QString PVGUI_ViewWindow::getVisualParameters()
00078 {
00079   return SUIT_ViewWindow::getVisualParameters();
00080 }
00081 
00086 void PVGUI_ViewWindow::setVisualParameters( const QString& parameters )
00087 {
00088   SUIT_ViewWindow::setVisualParameters( parameters );
00089 }
00090 
00091 
00095 pqTabbedMultiViewWidget* PVGUI_ViewWindow::getMultiViewManager() const
00096 {
00097   return myPVMgr;
00098 }