1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_PreviewDlg.cxx
25 // Author : Roman NIKOLAEV, Open CASCADE S.A.S.
31 #include "SMESHGUI_PreviewDlg.h"
32 #include "SMESHGUI_MeshEditPreview.h"
33 #include "SMESHGUI_VTKUtils.h"
34 #include "SMESHGUI_Utils.h"
37 #include <SUIT_Desktop.h>
43 //=================================================================================
44 // class : SMESHGUI_SMESHGUI_PreviewDlg()
46 //=================================================================================
47 SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
48 mySMESHGUI(theModule),
49 QDialog(SMESH::GetDesktop( theModule )) {
50 mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
53 //=================================================================================
54 // function : ~SMESHGUI_PreviewDlg()
55 // purpose : Destroys the object and frees any allocated resources
56 //=================================================================================
57 SMESHGUI_PreviewDlg::~SMESHGUI_PreviewDlg()
62 //=================================================================================
63 // function : showPreview
64 // purpose : Show preview in the viewer
65 //=================================================================================
66 void SMESHGUI_PreviewDlg::showPreview(){
68 mySimulation->SetVisibility(true);
71 //=================================================================================
72 // function : hidePreview
73 // purpose : Hide preview in the viewer
74 //=================================================================================
75 void SMESHGUI_PreviewDlg::hidePreview(){
77 mySimulation->SetVisibility(false);
80 //=================================================================================
81 // function : connectPreviewControl
82 // purpose : Connect the preview check box
83 //=================================================================================
84 void SMESHGUI_PreviewDlg::connectPreviewControl(){
85 connect(myPreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(onDisplaySimulation(bool)));
89 //=================================================================================
90 // function : toDisplaySimulation
92 //=================================================================================
93 void SMESHGUI_PreviewDlg::toDisplaySimulation() {
94 onDisplaySimulation(true);
97 //=================================================================================
98 // function : onDisplaySimulation
100 //=================================================================================
101 void SMESHGUI_PreviewDlg::onDisplaySimulation(bool toDisplayPreview) {
102 //Empty implementation here