Salome HOME
Drawing of zones in OCC view improved.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.cxx
1 // Copyright (C) 2007-2013  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 #include "HYDROGUI_CalculationDlg.h"
24
25 #include "HYDROGUI_ObjSelector.h"
26 #include "HYDROGUI_Tool.h"
27
28 #include <SUIT_FileDlg.h>
29 #include <SUIT_ResourceMgr.h>
30 #include <SUIT_Session.h>
31
32 #include <QGroupBox>
33 #include <QLabel>
34 #include <QLayout>
35 #include <QLineEdit>
36 #include <QPicture>
37 #include <QToolButton>
38
39 HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle )
40 : HYDROGUI_InputPanel( theModule, theTitle )
41 {
42   // Calculation name
43   myObjectNameGroup = new QGroupBox( tr( "CALCULATION_NAME" ), mainFrame() );
44
45   myObjectName = new QLineEdit( myObjectNameGroup );
46
47   QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
48   aNameLayout->setMargin( 5 );
49   aNameLayout->setSpacing( 5 );
50   aNameLayout->addWidget( new QLabel( tr( "NAME" ), myObjectNameGroup ) );
51   aNameLayout->addWidget( myObjectName );
52
53   QGroupBox* aBndGroup = new QGroupBox( tr( "CALCULATION_BOUNDARY" ), mainFrame() );
54
55   myBndPolyline = new HYDROGUI_ObjSelector( theModule, KIND_POLYLINE, aBndGroup );
56
57   QBoxLayout* aBndLayout = new QHBoxLayout( aBndGroup );
58   aBndLayout->setMargin( 5 );
59   aBndLayout->setSpacing( 5 );
60   aBndLayout->addWidget( new QLabel( tr( "BOUNDARY_POLYLINE" ), aBndGroup ) );
61   aBndLayout->addWidget( myBndPolyline );
62
63   // Common
64   addWidget( myObjectNameGroup );
65   addWidget( aBndGroup );
66   addStretch();
67 }
68
69 HYDROGUI_CalculationDlg::~HYDROGUI_CalculationDlg()
70 {
71 }
72
73 void HYDROGUI_CalculationDlg::reset()
74 {
75   myObjectName->clear();
76
77   myBndPolyline->Clear();
78 }
79
80 void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )
81 {
82   myObjectName->setText( theName );
83 }
84
85 QString HYDROGUI_CalculationDlg::getObjectName() const
86 {
87   return myObjectName->text();
88 }
89
90 void HYDROGUI_CalculationDlg::setPolylineName( const QString& theName )
91 {
92   myBndPolyline->SetName( theName );
93 }
94
95 QString HYDROGUI_CalculationDlg::getPolylineName() const
96 {
97   return myBndPolyline->GetName();
98 }
99
100
101