1 // Copyright (C) 2007-2013 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 #include "HYDROGUI_CalculationDlg.h"
25 #include "HYDROGUI_ObjSelector.h"
26 #include "HYDROGUI_Tool.h"
28 #include <SUIT_FileDlg.h>
29 #include <SUIT_ResourceMgr.h>
30 #include <SUIT_Session.h>
37 #include <QToolButton>
39 HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle )
40 : HYDROGUI_InputPanel( theModule, theTitle )
43 myObjectNameGroup = new QGroupBox( tr( "CALCULATION_NAME" ), mainFrame() );
45 myObjectName = new QLineEdit( myObjectNameGroup );
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 );
53 QGroupBox* aBndGroup = new QGroupBox( tr( "CALCULATION_BOUNDARY" ), mainFrame() );
55 myBndPolyline = new HYDROGUI_ObjSelector( theModule, KIND_POLYLINE, aBndGroup );
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 );
64 addWidget( myObjectNameGroup );
65 addWidget( aBndGroup );
69 HYDROGUI_CalculationDlg::~HYDROGUI_CalculationDlg()
73 void HYDROGUI_CalculationDlg::reset()
75 myObjectName->clear();
77 myBndPolyline->Clear();
80 void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )
82 myObjectName->setText( theName );
85 QString HYDROGUI_CalculationDlg::getObjectName() const
87 return myObjectName->text();
90 void HYDROGUI_CalculationDlg::setPolylineName( const QString& theName )
92 myBndPolyline->SetName( theName );
95 QString HYDROGUI_CalculationDlg::getPolylineName() const
97 return myBndPolyline->GetName();