1 // Copyright (C) 2010-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : PVGUI_ViewWindow.cxx
20 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
23 #include "PVGUI_ViewWindow.h"
25 #include <SUIT_ViewManager.h>
26 #include <SUIT_ResourceMgr.h>
27 #include <SUIT_Session.h>
28 #include <SUIT_Desktop.h>
30 #include <pqTabbedMultiViewWidget.h>
31 #include <pqApplicationCore.h>
34 \class PVGUI_ViewWindow
35 \brief PVGUI view window.
40 \param theDesktop parent desktop window
41 \param theModel plt2d view model
43 PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theModel )
44 : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 )
47 myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
49 myPVMgr->setParent( this );
50 // This is mandatory, see setParent() method in Qt 4 documentation
52 setCentralWidget( myPVMgr );
54 qDebug("No multiViewManager defined");
59 As pqViewManager persists through the whole session,
60 the destructor first removes it from the children of this PVGUI_ViewWindow
61 to prevent its unexpected deletion.
63 PVGUI_ViewWindow::~PVGUI_ViewWindow()
66 myPVMgr->setParent( 0 );
69 setCentralWidget( 0 );
74 \brief Get the visual parameters of the view window.
75 \return visual parameters of this view window formatted to the string
77 QString PVGUI_ViewWindow::getVisualParameters()
79 return SUIT_ViewWindow::getVisualParameters();
83 \brief Restore visual parameters of the view window from the formated string
84 \param parameters view window visual parameters
86 void PVGUI_ViewWindow::setVisualParameters( const QString& parameters )
88 SUIT_ViewWindow::setVisualParameters( parameters );
93 \brief Returns the ParaView multi-view manager previously set with setMultiViewManager()
95 pqTabbedMultiViewWidget* PVGUI_ViewWindow::getMultiViewManager() const