Salome HOME
Documentation of the ParaView GUI integration.
[modules/paravis.git] / src / PVGUI / PVGUI_ViewWindow.cxx
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
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.
7 // 
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // File   : PVGUI_ViewWindow.cxx
20 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
21 //
22
23 #include "PVGUI_ViewWindow.h"
24
25 #include <SUIT_ViewManager.h>
26 #include <SUIT_ResourceMgr.h>
27 #include <SUIT_Session.h>
28 #include <SUIT_Desktop.h>
29
30 #include <pqViewManager.h>
31
32
33 /*!
34   \class PVGUI_ViewWindow
35   \brief PVGUI view window.
36 */
37
38 /*!
39   \brief Constructor.
40   \param theDesktop parent desktop window
41   \param theModel plt2d view model
42 */
43 PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theModel )
44   : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 )
45 {
46   myModel = theModel;
47 }
48
49 /*!
50   \brief Destructor.
51 */
52 PVGUI_ViewWindow::~PVGUI_ViewWindow()
53 {
54 }
55
56 /*!
57   \brief Custom event filter.
58   \param watched event receiver object
59   \param e event
60   \return \c true if further event processing should be stopped
61 */
62 bool PVGUI_ViewWindow::eventFilter( QObject* watched, QEvent* e )
63 {
64   return SUIT_ViewWindow::eventFilter( watched, e );
65 }
66
67
68 /*!
69   \brief Get the visual parameters of the view window.
70   \return visual parameters of this view window formatted to the string
71 */
72 QString PVGUI_ViewWindow::getVisualParameters()
73 {
74   return SUIT_ViewWindow::getVisualParameters();
75 }
76
77 /*!
78   \brief Restore visual parameters of the view window from the formated string
79   \param parameters view window visual parameters
80 */
81 void PVGUI_ViewWindow::setVisualParameters( const QString& parameters )
82 {
83   SUIT_ViewWindow::setVisualParameters( parameters );
84 }
85
86 /*!
87   \brief Sets the ParaView multi-view manager for this view window
88 */
89 void PVGUI_ViewWindow::setMultiViewManager( pqViewManager* viewMgr )
90 {
91   myPVMgr = viewMgr;
92   myPVMgr->setParent( this );
93   // This is mandatory, see setParent() documentation 
94   myPVMgr->show();
95   setCentralWidget( myPVMgr );
96   myPVMgr->installEventFilter( this );
97 }
98
99 /*!
100   \brief Returns the ParaView multi-view manager previously set with setMultiViewManager()
101 */
102 pqViewManager* PVGUI_ViewWindow::getMultiViewManager() const
103 {
104   return myPVMgr;
105 }