Salome HOME
PR: double nodes and flat elements for ASTER calculations in progress
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_PreviewDlg.cxx
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File   : SMESHGUI_PreviewDlg.cxx
25 // Author : Roman NIKOLAEV, Open CASCADE S.A.S.
26 // SMESH includes
27 //
28
29 //SMESH includes
30 #include "SMESHGUI.h"
31 #include "SMESHGUI_PreviewDlg.h"
32 #include "SMESHGUI_MeshEditPreview.h"
33 #include "SMESHGUI_VTKUtils.h"
34 #include "SMESHGUI_Utils.h"
35
36 //GUI includes
37 #include <SUIT_Desktop.h>
38
39 //QT includes
40 #include <QCheckBox>
41
42
43 //=================================================================================
44 // class    : SMESHGUI_SMESHGUI_PreviewDlg()
45 // purpose  :
46 //=================================================================================
47 SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
48   mySMESHGUI(theModule),
49   QDialog(SMESH::GetDesktop( theModule )) {
50   mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
51 }
52
53 //=================================================================================
54 // function : ~SMESHGUI_PreviewDlg()
55 // purpose  : Destroys the object and frees any allocated resources
56 //=================================================================================
57 SMESHGUI_PreviewDlg::~SMESHGUI_PreviewDlg()
58 {
59   delete mySimulation;
60 }
61
62 //=================================================================================
63 // function : showPreview
64 // purpose  : Show preview in the viewer
65 //=================================================================================
66 void SMESHGUI_PreviewDlg::showPreview(){
67   if(mySimulation)
68     mySimulation->SetVisibility(true);
69 }
70
71 //=================================================================================
72 // function : hidePreview
73 // purpose  : Hide preview in the viewer
74 //=================================================================================
75 void SMESHGUI_PreviewDlg::hidePreview(){
76   if(mySimulation)
77     mySimulation->SetVisibility(false);
78 }
79
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)));
86 }
87
88
89 //=================================================================================
90 // function : toDisplaySimulation
91 // purpose  : 
92 //=================================================================================
93 void SMESHGUI_PreviewDlg::toDisplaySimulation() {
94   onDisplaySimulation(true);
95 }
96
97 //=================================================================================
98 // function : onDisplaySimulation
99 // purpose  : 
100 //=================================================================================
101 void SMESHGUI_PreviewDlg::onDisplaySimulation(bool toDisplayPreview) {
102   //Empty implementation here
103 }